Packageorg.servebox.commons.map
Classpublic class DictionaryTable
ImplementsIBasicObject, IMap
SubclassesSortedDictionaryTable, WordIndex

DictionaryTable is a data structure that maps keys to values.
Every value is an object, but unlike the HashTable, every key should be a String. In a DictionaryTable instance, every key is associated with at most one value. Given a DictionaryTable and a key, the associated element can be looked up.
Any non-null IBasicObject instance can be used as the value. Use ObjectWrapper or ArrayWrapper to wrap objects out of the IBasicObject hierarchy.



Protected Properties
 PropertyDefined by
  _internalDict : Object
Storage object.
DictionaryTable
  _keys : Array
Keys cache.
DictionaryTable
Public Methods
 MethodDefined by
  
Creates a new DictionaryTable object.
DictionaryTable
  
clear():void
Removes all mappings from this map (optional operation).
DictionaryTable
  
Creates a shallow copy of this hashtable.
DictionaryTable
  
contains(value:IBasicObject):Boolean
DictionaryTable
  
containsKey(key:Object):Boolean
Returns true if this map contains a mapping for the specified key.
DictionaryTable
  
containsValue(value:IBasicObject):Boolean
Returns true if this map maps one or more keys to the specified value.
DictionaryTable
  
elements():Array
DictionaryTable
  
equals(value:IBasicObject):Boolean
Compares the specified Object with this Map for equality, as per the definition in the Map interface.
DictionaryTable
  
get(key:Object):IBasicObject
DictionaryTable
  
getKey(value:Object):String
Return the key for the value
DictionaryTable
  
hashCode():int
Returns the hashcode of the object.
DictionaryTable
  
isEmpty():Boolean
Tests if this dictionary maps no keys to value.
DictionaryTable
  
keys():Array
Returns an Array of the keys in this dictionary.
DictionaryTable
  
keySet():Array
Returns a view of the keys contained in this map.
DictionaryTable
  
needleMap(neededKeys:Array):IMap
Copies the key/values pair using the specified set of keys to a new map instance.
DictionaryTable
  
put(key:Object, value:IBasicObject):Object
Maps the specified key to the specified value in this dictionary.
The DictionaryTable uses String instances as keys.
DictionaryTable
  
putAll(t:IMap):void
Copies all of the mappings from the specified Map to this Hashtable These mappings will replace any mappings that this Hashtable had for any of the keys currently in the specified Map.
DictionaryTable
  
remove(key:Object):Object
Removes the key (and its corresponding value) from this dictionary.
DictionaryTable
  
size():int
Returns the number of entries (distinct keys) in this dictionary.
DictionaryTable
  
toString():String
Returns the string representation of the specified object.
DictionaryTable
  
values():Array
Returns a collection view of the values contained in this map.
DictionaryTable
Property detail
_internalDictproperty
protected var _internalDict:Object

Storage object.

_keysproperty 
protected var _keys:Array

Keys cache.

Constructor detail
DictionaryTable()constructor
public function DictionaryTable()

Creates a new DictionaryTable object.

Method detail
clear()method
public function clear():void

Removes all mappings from this map (optional operation).

clone()method 
public function clone():DictionaryTable

Creates a shallow copy of this hashtable.

Returns
DictionaryTable
contains()method 
public function contains(value:IBasicObject):Boolean

Parameters
value:IBasicObject

Returns
Boolean
containsKey()method 
public function containsKey(key:Object):Boolean

Returns true if this map contains a mapping for the specified key.

Parameters
key:Object

Returns
Boolean
containsValue()method 
public function containsValue(value:IBasicObject):Boolean

Returns true if this map maps one or more keys to the specified value.

Parameters
value:IBasicObject

Returns
Boolean
elements()method 
public function elements():Array

Returns
Array
equals()method 
public function equals(value:IBasicObject):Boolean

Compares the specified Object with this Map for equality, as per the definition in the Map interface.

Parameters
value:IBasicObject

Returns
Boolean
get()method 
public function get(key:Object):IBasicObject

Parameters
key:Object

Returns
IBasicObject
getKey()method 
public function getKey(value:Object):String

Return the key for the value

Parameters
value:Object

Returns
String
hashCode()method 
public function hashCode():int

Returns the hashcode of the object.

Returns
int
isEmpty()method 
public function isEmpty():Boolean

Tests if this dictionary maps no keys to value.

Returns
Boolean
keys()method 
public function keys():Array

Returns an Array of the keys in this dictionary.

Returns
Array
keySet()method 
public function keySet():Array

Returns a view of the keys contained in this map.

Returns
Array
needleMap()method 
public function needleMap(neededKeys:Array):IMap

Copies the key/values pair using the specified set of keys to a new map instance.

Parameters
neededKeys:Array

Returns
IMap
put()method 
public function put(key:Object, value:IBasicObject):Object

Maps the specified key to the specified value in this dictionary.
The DictionaryTable uses String instances as keys.

Parameters
key:Object
 
value:IBasicObject

Returns
Object
putAll()method 
public function putAll(t:IMap):void

Copies all of the mappings from the specified Map to this Hashtable These mappings will replace any mappings that this Hashtable had for any of the keys currently in the specified Map.

Parameters
t:IMap
remove()method 
public function remove(key:Object):Object

Removes the key (and its corresponding value) from this dictionary.

Parameters
key:Object

Returns
Object
size()method 
public function size():int

Returns the number of entries (distinct keys) in this dictionary.

Returns
int
toString()method 
public function toString():String

Returns the string representation of the specified object.

Returns
String
values()method 
public function values():Array

Returns a collection view of the values contained in this map.

Returns
Array