K - Dictionary key typeV - Dictionary value typepublic class TailScopedDictionary<K,V> extends ScopedDictionary<K,V>
ScopedDictionary that contains TailMap collections.
Supported scope: context local.| Modifier and Type | Class and Description |
|---|---|
private static class |
TailScopedDictionary.EmptyTailMap<K,V>
An immutable empty static subclass of TailHashMap.
|
ScopedDictionary.Node<K,V>| Modifier and Type | Field and Description |
|---|---|
private static TailMap |
EMPTY_TAILMAP
EMPTY_TAILMAP is a singleton used for getDictionaryAtScope(int, boolean) when there is no
dictionary at that level. |
| Constructor and Description |
|---|
TailScopedDictionary()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Set<K> |
factoryHashSetFromMap()
Factory method for a
Set as returned by ScopedDictionary.keySet() |
protected java.util.Map<K,java.lang.Boolean> |
factoryIdentityHashMap()
Factory method for an
IdentityHashMap |
protected java.util.Map<K,V> |
factoryNodeHashMap(int size)
Factory method for a
HashMap at the scope items (the ScopedDictionary.Node
inner class) |
protected java.util.Map<K,V> |
factoryNodeIdentityHashMap(int size)
Factory method for an
IdentityHashMap at the scope items (the ScopedDictionary.Node inner class) |
TailMap<K,V> |
getDictionaryAtScope(int scope,
boolean create)
Returns the dictionary from the scope specified, or
null if
the specified scope does not exist. |
addEntry, addEntryAt, addScope, apply, clear, copyAll, deleteEntry, deleteScope, deleteScope, dump, dump, dumpCurrentScope, dumpCurrentScope, entrySet, entrySet, getIdentityKeys, getNodeAt, getScope, getScopeAt, getValueAtScope, keySet, keySet, locate, locate, lookup, lookup, lookup, removeEntryAtScope, removeEntryThroughScope, reverseLookup, reverseLookup, setIdentityKeys, setScope, setScopeAt, setValueAtScope, size, values, valuesprivate static final TailMap EMPTY_TAILMAP
EMPTY_TAILMAP is a singleton used for getDictionaryAtScope(int, boolean) when there is no
dictionary at that level.public TailMap<K,V> getDictionaryAtScope(int scope, boolean create)
null if
the specified scope does not exist.getDictionaryAtScope in class ScopedDictionary<K,V>scope - The depth (in number of scopes from the top of the stack) at
which the value must be set. Use -1 for the global scope.create - true to create a dictionary for this scope if one
does not already exist; false to have an empty
(immutable) dictionary returned if one does not already exist.create is set to
false. If the scope itself does not exist, then
null is returned.protected java.util.Map<K,java.lang.Boolean> factoryIdentityHashMap()
IdentityHashMapfactoryIdentityHashMap in class ScopedDictionary<K,V>TailIdentityHashMapprotected java.util.Set<K> factoryHashSetFromMap()
Set as returned by ScopedDictionary.keySet()
Currently, the caller can't yet access TailMap.flagIterating(), since a Set
is returned. For now, we assume that it's not a realistic scenario in FWD.
Redesign when needed (symptom would be a concurrency exception while iterating keySet).
factoryHashSetFromMap in class ScopedDictionary<K,V>Collections.newSetFromMap of a new TailHashMapprotected java.util.Map<K,V> factoryNodeIdentityHashMap(int size)
IdentityHashMap at the scope items (the ScopedDictionary.Node inner class)factoryNodeIdentityHashMap in class ScopedDictionary<K,V>size - The maximum expected size of the MapTailIdentityHashMapprotected java.util.Map<K,V> factoryNodeHashMap(int size)
HashMap at the scope items (the ScopedDictionary.Node
inner class)factoryNodeHashMap in class ScopedDictionary<K,V>size - The maximum expected size of the MapTailHashMap