Package com.fasterxml.jackson.jr.ob.impl
Class DeferredMap
- java.lang.Object
-
- java.util.AbstractMap<Object,Object>
-
- com.fasterxml.jackson.jr.ob.impl.DeferredMap
-
public class DeferredMap extends AbstractMap<Object,Object>
A specializedMap
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description DeferredMap(boolean ordered)
DeferredMap(boolean ordered, int initialSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
Methods inherited from class java.util.AbstractMap
putAll
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<Object,Object>
- Overrides:
containsValue
in classAbstractMap<Object,Object>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<Object,Object>
- Overrides:
containsKey
in classAbstractMap<Object,Object>
-
clear
public void clear()
-
values
public Collection<Object> values()
-
equals
public boolean equals(Object other)
-
hashCode
public int hashCode()
-
toString
public String toString()
- Overrides:
toString
in classAbstractMap<Object,Object>
-
clone
protected Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classAbstractMap<Object,Object>
- Throws:
CloneNotSupportedException
-
buildIfNeeded
protected void buildIfNeeded()
-
-