public class DeferredMap extends AbstractMap<Object,Object>
Map
implementation that will collect
entries during building, but only materialize full lookup structure
when needed; that is, actual building of hash lookup is deferred.
Inspired by lazily initialized Map used by Boon library.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
DeferredMap(boolean ordered) |
DeferredMap(boolean ordered,
int initialSize) |
Modifier and Type | Method and Description |
---|---|
protected Map<Object,Object> |
_buildMap(int expSize) |
protected void |
buildIfNeeded() |
void |
clear() |
protected Object |
clone() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<Object,Object>> |
entrySet() |
boolean |
equals(Object other) |
Object |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Set<Object> |
keySet() |
Object |
put(Object key,
Object value) |
Object |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<Object> |
values() |
putAll
public DeferredMap(boolean ordered)
public DeferredMap(boolean ordered, int initialSize)
public int size()
public boolean isEmpty()
public boolean containsValue(Object value)
containsValue
in interface Map<Object,Object>
containsValue
in class AbstractMap<Object,Object>
public boolean containsKey(Object key)
containsKey
in interface Map<Object,Object>
containsKey
in class AbstractMap<Object,Object>
public void clear()
public Collection<Object> values()
public boolean equals(Object other)
public int hashCode()
public String toString()
toString
in class AbstractMap<Object,Object>
protected Object clone() throws CloneNotSupportedException
clone
in class AbstractMap<Object,Object>
CloneNotSupportedException
protected void buildIfNeeded()
Copyright © 2014–2015 FasterXML. All rights reserved.