S
- The address element type for looking up child scopesK
- The key type for the mapV
- The value type for the mapT
- The implementation type (used to type returns from getScope in subclasses)public abstract class ScopeMap<S,K,V,T extends ScopeMap<S,K,V,T>> extends DelegatingMap<K,V> implements Scope<S,K,V,T>
Scope
using a factory method to create child scopes when requested by getScope()
In general query usage, the ScopeMap representing the global scope will be passed and clients will look up the child scope which they wish to use to resolve map keys or store map keys at.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
ScopeMap()
Build a scope with no parent scope and empty children.
|
ScopeMap(Map<K,V> parent)
Build a scope with a parent scope.
|
Modifier and Type | Method and Description |
---|---|
protected abstract T |
factory(T scope)
Used to construct child scopes.
|
T |
getScope(List<S> scopeKeys)
Resolves a child scope.
|
T |
getScope(S... scopeKeys)
Helper function converting the varargs to array.
|
clear, clearLocal, containsKey, containsValue, entrySet, equals, flatView, get, hashCode, keySet, put, remove, removeLocal, size, values
forEach, getOrDefault, removeEldestEntry, replaceAll
clone, compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace
toString
finalize, getClass, notify, notifyAll, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public ScopeMap()
public T getScope(List<S> scopeKeys)
Scope
Unless otherwise noted implementations should guarantee lazy initialization of child scopes.
public T getScope(S... scopeKeys)
scopeKeys
- The subtree address expressed as a sequence of scopeKeysCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.