K
- The type of keys maintained by this TieredMapV
- The type of mapped valuespublic class TieredMap<K,V> extends Object implements Map<K,V>
A TieredMap is a type of unmodifiable Map defined by an ordered list of other Maps, called tiers. For any given key, the key's corresponding value in the TieredMap is the key's value in the lowest-indexed tier that contains it as a key. If no tier contains a key, the key is not in the TieredMap. If any of a TieredMap's tiers are modified after the TieredMap is constructed, the TieredMap's behavior is undefined.
Constructor and Description |
---|
TieredMap(List<Map<K,V>> tiers)
Creates a new TieredMap that uses a copy of the specified list of Maps.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
List<Map<K,V>> |
getTiers()
Returns an unmodifiable List view of this TieredMap's tiers.
|
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public List<Map<K,V>> getTiers()
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
Copyright © 2020. All rights reserved.