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 interface Scope<S,K,V,T extends Scope<S,K,V,T>> extends Map<K,V>
A Scope may have child scopes which it encloses. It may have a parent scope which encloses it. Values defined in a parent scope will be available via (@link Map#get(K k)} on itself, unless the scope itself defines (and therefore overshadows) that entry.
Changes to a scope will be available to it's child scopes unless they overshadow the corresponding key.
The remove and clear operations are not supported on Scopes because parent scopes cannot be directly accessed or altered.
Modifier and Type | Method and Description |
---|---|
T |
getScope(List<S> scopeKeys)
Resolves a child scope.
|
default V |
putScope(S scopeKey,
K key,
V value)
Puts a key value pair into an immediate child scope.
|
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
T getScope(List<S> scopeKeys)
Unless otherwise noted implementations should guarantee lazy initialization of child scopes.
scopeKeys
- The subtree address expressed as a sequence of scopeKeysdefault V putScope(S scopeKey, K key, V value)
scopeKey
- The name of the child scopekey
- The key for the value being storedvalue
- The value being storedDelegatingMap.put(Object, Object)
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.