Package | com.yworks.support |
Class | public class DictionaryMapper |
Inheritance | DictionaryMapper Object |
Implements | IRoundtripMapper |
Dictionary
See also
Property | Defined By | ||
---|---|---|---|
autoSerialize : Boolean
Whether this mapper should be serialized when the graph it
is registered with is sent to the server. | DictionaryMapper | ||
defaultValue : * | DictionaryMapper | ||
name : String [read-only]
The attribute name. | DictionaryMapper | ||
scope : String [read-only]
One of
GraphMLConstants.SCOPE_ALL
GraphMLConstants.SCOPE_NODE
GraphMLConstants.SCOPE_EDGE
GraphMLConstants.SCOPE_GRAPH
GraphMLConstants.SCOPE_PORT
| DictionaryMapper | ||
valueType : String [read-only]
One of
GraphMLConstants.TYPE_INT
GraphMLConstants.TYPE_LONG
GraphMLConstants.TYPE_FLOAT
GraphMLConstants.TYPE_DOUBLE
GraphMLConstants.TYPE_BOOLEAN
GraphMLConstants.TYPE_STRING
GraphMLConstants.TYPE_COMPLEX
| DictionaryMapper |
Method | Defined By | ||
---|---|---|---|
DictionaryMapper(weakKeys:Boolean = false, name:String = null, scope:String = null, valueType:String = null, autoSerialize: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 | ||
DictionaryMapper | |||
unMapValue(key:Object):void
Removes a previously created association with the given key. | DictionaryMapper | ||
Creates an Iterator over the values. | DictionaryMapper |
autoSerialize | property |
autoSerialize:Boolean
Whether this mapper should be serialized when the graph it is registered with is sent to the server.
public function get autoSerialize():Boolean
public function set autoSerialize(value:Boolean):void
defaultValue | property |
defaultValue:*
public function get defaultValue():*
public function set defaultValue(value:any):void
name | property |
name:String
[read-only]
The attribute name.
Used both as a key for the graph's IMapperRegistry
and for GraphML serialization.
public function get name():String
scope | property |
scope:String
[read-only] One of
public function get scope():String
valueType | property |
valueType:String
[read-only] One of
public function get valueType():String
DictionaryMapper | () | Constructor |
public function DictionaryMapper(weakKeys:Boolean = false, name:String = null, scope:String = null, valueType:String = null, autoSerialize: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.
| |
name:String (default = null ) — The name of the attribute mapper with which the dictionary is registered if it
is marked for auto serialization.
| |
scope:String (default = null ) — The scope of the auto serialized attribute mapper as defined in the
GraphMLConstants.SCOPE constants.
| |
valueType:String (default = null ) — The type of the auto serialized attribute mapper as defined in the
GraphMLConstants.TYPE constants.
| |
autoSerialize:Boolean (default = false ) — If this mapper is registered to a graph's mapperRegistry
and autoSerialize is set to true , this mapper will be automatically
serialized as attribute mapper
|
clear | () | method |
public function clear():void
Removes all entries from this mapper.
createInverse | () | method |
public static function createInverse(mapper:IMapper, keys:Iterator):DictionaryMapper
Inverts 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.
Parameters
mapper: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.
Parameters
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):Object
Finds 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.
Parameters
key: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):void
Associates the given key with the value provided, removing previous associations.
Parameters
key:Object — The key to associate with a value.
| |
value:Object — The value to associate the key with.
|
register | () | method |
public function register(graph:IGraph):DictionaryMapper
Parameters
graph:IGraph |
DictionaryMapper — this , for chaining
|
unMapValue | () | method |
public function unMapValue(key:Object):void
Removes a previously created association with the given key.
Parameters
key: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.
|