A simple HashMap<TKey,TValue>-based implementation of the IMapperRegistry interface.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.MapperRegistry
Properties
Gets an enumerable over all tags that have been used to register mapper implementations with this interface.
Implements
Methods
Registers a mapper for the given tag.
Remarks
tag
, it will be replaced.Type Parameters
- K
- V
Parameters
A map of options to pass to the method.
- keyType - Class
- The key type for the mapper.
- valueType - Class
- The value type for the mapper.
- tag - Object
- The tag to use.
- mapper - IMapper<K,V>
- The mapper to register.
See Also
Implements
createConstantMapper
<K,V>(keyType: Class, valueType: Class, tag: Object, constant: V) : IMapper<K,V>Creates a read-only IMapper<K,V> implementation and adds it to the registry
using the provided tag
.
Remarks
tag
, it will be replaced.Type Parameters
- K
- The type of the keys of the mapper.
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- keyType - Class
- valueType - Class
- tag - Object
- The tag.
- constant - V
- The value to yield during IMapper<K,V> reads.
Returns
- ↪IMapper<K,V>
- The newly created mapper instance.
See Also
Defined in
Creates a simple read-only IMapper<K,V> implementation with key type INode and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - NodeDpKey<V>
- The tag.
- constant - V
- The value to yield during IMapper<K,V> reads.
Returns
- ↪IMapper<INode,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Defined in
Creates a simple read-only IMapper<K,V> implementation with key type IEdge and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - EdgeDpKey<V>
- The tag.
- constant - V
- The value to yield during IMapper<K,V> reads.
Returns
- ↪IMapper<IEdge,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Defined in
Creates a simple read-only IMapper<K,V> implementation with key type ILabel and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - ILabelLayoutDpKey<V>
- The tag.
- constant - V
- The value to yield during IMapper<K,V> reads.
Returns
- ↪IMapper<ILabel,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Defined in
createDelegateMapper
<K,V>(keyType: Class, valueType: Class, tag: Object, getter: function(K):V) : IMapper<K,V>Creates a delegate-based read-only IMapper<K,V> implementation and adds it to the registry
using the provided tag
.
Remarks
tag
, it will be replaced.Type Parameters
- K
- The type of the keys of the mapper.
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- keyType - Class
- valueType - Class
- tag - Object
- The tag.
- getter - function(K):V
- The getter delegate to which IMapper<K,V> reads will be delegated.
Signature Details
function(key: K) : V
A delegate that mimics the get access.Parameters
- key - K
- The key of the mapping.
Returns
- V
- The value or a suitable default that is associated with
key
.
Returns
- ↪IMapper<K,V>
- The newly created mapper instance.
See Also
Defined in
Creates a delegate-based read-only IMapper<K,V> implementation with key type INode and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - NodeDpKey<V>
- The tag.
- getter - function(INode):V
- The getter delegate to which IMapper<K,V> reads will be delegated.
Returns
- ↪IMapper<INode,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Defined in
Creates a delegate-based read-only IMapper<K,V> implementation with key type IEdge and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - EdgeDpKey<V>
- The tag.
- getter - function(IEdge):V
- The getter delegate to which IMapper<K,V> reads will be delegated.
Returns
- ↪IMapper<IEdge,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Defined in
Creates a delegate-based read-only IMapper<K,V> implementation with key type ILabel and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - ILabelLayoutDpKey<V>
- The tag.
- getter - function(ILabel):V
- The getter delegate to which IMapper<K,V> reads will be delegated.
Returns
- ↪IMapper<ILabel,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Defined in
Creates and adds a new Mapper<K,V> to the registry
using the provided tag
.
Remarks
tag
, it will be replaced.Type Parameters
- K
- The type of the keys of the mapper.
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
Returns
- ↪Mapper<K,V>
- The newly created mapper instance.
See Also
Defined in
Creates and adds a new Mapper<K,V> with key type INode to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - NodeDpKey<V>
- The tag.
Returns
- ↪Mapper<INode,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Defined in
Creates and adds a new Mapper<K,V> with key type ILabel to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - ILabelLayoutDpKey<V>
- The tag.
Returns
- ↪Mapper<ILabel,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Defined in
Creates and adds a new Mapper<K,V> with key type IEdge to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - EdgeDpKey<V>
- The tag.
Returns
- ↪Mapper<IEdge,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Defined in
Returns a mapper that has previously been registered with this instance for the given tag.
Type Parameters
- K
- V
Parameters
A map of options to pass to the method.
- tag - Object
- The tag to use to look up the mapper.
Returns
- ↪IMapper<K,V>
- The previously registered instance or
null
.
See Also
Implements
Gets the mapper meta data for the mapper that is registered using the tag
.
Parameters
A map of options to pass to the method.
- tag - Object
- The tag.
Returns
- ↪MapperMetadata
- The meta data or
null
if there is no such mapper registered for the given tag.
Implements
Removes a previously registered mapper for the given tag.
Parameters
A map of options to pass to the method.
- tag - Object
- The tag that has been used for registering the mapper.
Implements
Sets the mapper meta data for the mapper that has been registered using the provided tag
.
Parameters
A map of options to pass to the method.
- tag - Object
- The tag.
- metadata - MapperMetadata
- The meta data to store with the mapper.
Throws
- Exception({ name: 'ArgumentError' })
- If the keyType or valueType mismatch the mapper instance in the registry.