| Package | com.yworks.support |
| Class | public class DictionaryMapper |
| Implements | IMapper |
Dictionary
See also
| Method | Defined by | ||
|---|---|---|---|
|
DictionaryMapper(weakKeys:Boolean = false)
Creates a new instance.
| DictionaryMapper | ||
|
clear():void
Removes all entries from this mapper.
| DictionaryMapper | ||
|
[static]
Inverts a mapper so that its keys will become its values and its values will be used as keys.
| DictionaryMapper | ||
|
hasValue(key:Object):Boolean
Returns
true if the given key has a value mapped to. | DictionaryMapper | ||
|
Creates an
Iterator over the keys. | DictionaryMapper | ||
|
lookupValue(key:Object):Object
Finds the associated value for the given key in the map.
| DictionaryMapper | ||
|
mapValue(key:Object, value:Object):void
Associates the given key with the value provided, removing previous associations.
| DictionaryMapper | ||
|
unMapValue(key:Object):void
Removes a previously created association with the given key.
| DictionaryMapper | ||
|
Creates an
Iterator over the values. | DictionaryMapper | ||
| DictionaryMapper | () | constructor |
public function DictionaryMapper(weakKeys:Boolean = false)Creates a new instance.
ParametersweakKeys:Boolean (default = false) — Instructs the Dictionary object to use "weak" references on object keys. If the only reference to an object is in the specified Dictionary object, the key is eligible for garbage collection and is removed from the table when the object is collected.
|
| clear | () | method |
public function clear():voidRemoves all entries from this mapper.
| createInverse | () | method |
public static function createInverse(mapper:IMapper, keys:Iterator):DictionaryMapperInverts a mapper so that its keys will become its values and its values will be used as keys.
Uses a selection of keys to invert.
Parametersmapper:IMapper — The mapper to invert.
|
|
keys:Iterator — An iterator over the keys to invert.
|
DictionaryMapper |
| hasValue | () | method |
public function hasValue(key:Object):Boolean
Returns true if the given key has a value mapped to.
key:Object — The key to test.
|
Boolean — true if a value has been mapped to the given key.
|
| keys | () | method |
public function keys():Iterator
Creates an Iterator over the keys.
Iterator —
An Iterator over the keys.
|
| lookupValue | () | method |
public function lookupValue(key:Object):ObjectFinds the associated value for the given key in the map.
Implementations normally should not throw an error if there was no association found for the key provided. Instead they should return a default value depending on the context they are used in.
Parameterskey:Object — The key to find the value for.
|
Object — The value of an association or a default value if no such association exists.
|
| mapValue | () | method |
public function mapValue(key:Object, value:Object):voidAssociates the given key with the value provided, removing previous associations.
Parameterskey:Object — The key to associate with a value.
|
|
value:Object — The value to associate the key with.
|
| unMapValue | () | method |
public function unMapValue(key:Object):voidRemoves a previously created association with the given key.
Parameterskey:Object — The key to remove from the mapping.
|
| values | () | method |
public function values():Iterator
Creates an Iterator over the values.
Iterator —
An Iterator over the values.
|