KeyType
- Type of keyValueType
- Type of valuepublic abstract class LazyMap<KeyType,ValueType> extends TreeMap<KeyType,ValueType> implements Map<KeyType,ValueType>
On get(Object)
, if a key is not found in the map,
getDefault(Object)
will be called to create the value for the given
key. This value is subsequently inserted into the map before being returned.
Call TreeMap.containsKey(Object)
to check if a key is in the map.
Implementations of this class must implement getDefault(Object)
to
specify the default value to create.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LazyMap() |
LazyMap(Comparator<? super KeyType> comparator) |
LazyMap(Map<? extends KeyType,? extends ValueType> m) |
LazyMap(SortedMap<KeyType,? extends ValueType> m) |
Modifier and Type | Method and Description |
---|---|
ValueType |
get(Object key) |
abstract ValueType |
getDefault(KeyType key) |
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, size, subMap, subMap, tailMap, tailMap, values
equals, hashCode, isEmpty, toString
public LazyMap()
public LazyMap(Comparator<? super KeyType> comparator)
Copyright © 2014 myGrid. All rights reserved.