java.lang.Object | +--org.apache.commons.collections.map.AbstractMapDecorator | +--org.apache.commons.collections.map.LazyMap | +--org.apache.commons.collections.map.LazySortedMapAll Implemented Interfaces:
LazySortedMap(SortedMap map, Factory factory) Constructor that wraps (not copies). |
LazySortedMap(SortedMap map, Transformer factory) Constructor that wraps (not copies). |
Comparator | |
static SortedMap | decorate(SortedMap map, Factory factory) Factory method to create a lazily instantiated sorted map. |
static SortedMap | decorate(SortedMap map, Transformer factory) Factory method to create a lazily instantiated sorted map. |
Object | firstKey() |
SortedMap | Gets the map being decorated. |
SortedMap | headMap(Object toKey) |
Object | lastKey() |
SortedMap | subMap(Object fromKey, Object toKey) |
SortedMap | tailMap(Object fromKey) |
protected LazySortedMap(SortedMap map, Factory factory)
- if map or factory is nullprotected LazySortedMap(SortedMap map, Transformer factory)
- if map or factory is nullpublic Comparator comparator()
public static SortedMap decorate(SortedMap map, Factory factory)
- if map or factory is nullpublic static SortedMap decorate(SortedMap map, Transformer factory)
- if map or factory is nullpublic Object firstKey()
protected SortedMap getSortedMap()
public SortedMap headMap(Object toKey)
public Object lastKey()
public SortedMap subMap(Object fromKey, Object toKey)
public SortedMap tailMap(Object fromKey)
SortedMap
to create objects in the map on demand. When the get(Object) method is called with a key that does not exist in the map, the factory is used to create the object. The created object will be added to the map using the requested key. For instance: After the above code is executed,obj
will contain a newDate
instance. Furthermore, thatDate
instance is mapped to the "NOW" key in the map.