protected static class ScopedDictionary.Node<K,V>
extends java.lang.Object
implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<K,V> |
dictionary
Represents an instance of dictionary.
|
private java.lang.Object |
extra
Stores a user supplied object associated with the dictionary.
|
private boolean |
identityKeys
Flag indicating if the
dictionary's keys can use the identity hash code. |
private java.util.function.Function<java.lang.Integer,java.util.Map<K,V>> |
supplyHashMap
Points to a generator function that supplies a new HashMap.
|
private java.util.function.Function<java.lang.Integer,java.util.Map<K,V>> |
supplyIdentityHashMap
Points to a generator function that supplies a new IdentityHashMap.
|
| Modifier | Constructor and Description |
|---|---|
private |
Node(java.lang.Object extra,
boolean identityKeys,
java.util.function.Function<java.lang.Integer,java.util.Map<K,V>> supplyIdentityHashMap,
java.util.function.Function<java.lang.Integer,java.util.Map<K,V>> supplyHashMap)
The only constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected ScopedDictionary.Node<K,V> |
clone()
Clone this instance.
|
java.util.Map<K,V> |
getDictionary(boolean create)
Accesses the dictionary at this node.
|
java.lang.Object |
getExtra()
Accesses the user supplied object at this node.
|
void |
setExtra(java.lang.Object extra)
Replaces the user supplied object at this node.
|
private java.lang.Object extra
private final boolean identityKeys
dictionary's keys can use the identity hash code.private java.util.function.Function<java.lang.Integer,java.util.Map<K,V>> supplyIdentityHashMap
private Node(java.lang.Object extra,
boolean identityKeys,
java.util.function.Function<java.lang.Integer,java.util.Map<K,V>> supplyIdentityHashMap,
java.util.function.Function<java.lang.Integer,java.util.Map<K,V>> supplyHashMap)
extra - Any object that will be associated with this node.identityKeys - When true, the dictionary will be an IdentityHashMap.supplyIdentityHashMap - Points to a generator function that supplies a new IdentityHashMap.supplyHashMap - Points to a generator function that supplies a new HashMap.protected ScopedDictionary.Node<K,V> clone()
clone in class java.lang.Objectpublic java.util.Map<K,V> getDictionary(boolean create)
create - true to create a dictionary for this node if
one does not already exist; false to have null returned if one
does not already exist.null if there is no map object
associated with this node and 'create' flag is false.public java.lang.Object getExtra()
public void setExtra(java.lang.Object extra)
extra - Any object that will be associated with this node.