Packagecom.yworks.graph.model
Classpublic class ConstantMapper
InheritanceConstantMapper Inheritance Object
Implements com.yworks.support.IMapper

This mapper provides a single value for any key.



Public Methods
 MethodDefined By
  
ConstantMapper(constantValue:Object = null)
Creates a new instance which always returns the given value.
ConstantMapper
  
lookupValue(key:Object):Object
Always returns the constantValue passed to the constructor or set with mapValue.
ConstantMapper
  
mapValue(key:Object, value:Object):void
Changes the value to return for all keys.
ConstantMapper
  
unMapValue(key:Object):void
Changes the value to return for all keys to null.
ConstantMapper
Constructor Detail
ConstantMapper()Constructor
public function ConstantMapper(constantValue:Object = null)

Creates a new instance which always returns the given value.

Parameters
constantValue:Object (default = null) — The constant value to return for all queries.
Method Detail
lookupValue()method
public function lookupValue(key:Object):Object

Always returns the constantValue passed to the constructor or set with mapValue.

Parameters

key:Object — The key to return the value for.

Returns
Object — value The constantValue to return.
mapValue()method 
public function mapValue(key:Object, value:Object):void

Changes the value to return for all keys.

Parameters

key:Object — Not used here.
 
value:Object — The new constant value to return.

unMapValue()method 
public function unMapValue(key:Object):void

Changes the value to return for all keys to null.

Parameters

key:Object — Not used here.