This class is used as look-up key for registering IMapper<K,V> for LayoutNodes with a LayoutGraph.
Inheritance Hierarchy
DataKey<TValue>
NodeDataKey
Type Parameters
- TValue
- The type of the values that are returned by the
registered with this class.
Type Details
- yFiles module
- algorithms
See Also
LayoutGraphContext.addItemData(NodeDataKey,IMapper),
LayoutGraphContext.getItemData(NodeDataKey),
LayoutGraphContext.remove,
Data Keys
Constructors
Initializes a new instance of the NodeDataKey<TValue> class.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- id - string
- The unique identifier for this key. The id should be a combination of the namespace, class name, possible inner classes, and the field name of the NodeDataKey<TValue> instance, to ensure uniqueness. For example, if this NodeDataKey<TValue> instance is declared in the namespace 'yWorks.Layout.Organic' within the class 'OrganicLayout' with the field name 'ClusterIdDataKey', the id could be 'yWorks.Layout.Organic.OrganicLayout.ClusterIdDataKey'. If omitted, the key object itself is the identifier.
- fallbackValue - TValue
- A value of type
TValue
used as fallback if the registered IMapper<K,V> is indexed with a key which is not present.
Properties
Gets the unique identifier for this key or null
if none was specified.
Methods
Returns a hash code for this instance.
Returns
- ↪number
- A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Defined in
Returns whether this key is equal to the specified other
.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- other - DataKey<TValue>
- The other key to compare with this instance.
Returns
- ↪boolean
true
if the specified key is equal to this instance; otherwise,false
.