Package org.apache.groovy.json.internal
Class LazyMap
public class LazyMap extends AbstractMap<String,Object>
This maps only builds once you ask for a key for the first time.
It is designed to not incur the overhead of creating a map unless needed.
-
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
-
Method Summary
Modifier and Type Method Description void
clear()
LazyMap
clearAndCopy()
protected Object
clone()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<String,Object>>
entrySet()
boolean
equals(Object o)
Object
get(Object key)
static <V> V[]
grow(V[] array)
int
hashCode()
boolean
isEmpty()
Set<String>
keySet()
Object
put(String key, Object value)
void
putAll(Map m)
Object
remove(Object key)
int
size()
String
toString()
Collection<Object>
values()
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
-
Constructor Details
-
LazyMap
public LazyMap() -
LazyMap
public LazyMap(int initialSize)
-
-
Method Details
-
put
-
entrySet
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsValue
- Specified by:
containsValue
in interfaceMap<String,Object>
- Overrides:
containsValue
in classAbstractMap<String,Object>
-
containsKey
- Specified by:
containsKey
in interfaceMap<String,Object>
- Overrides:
containsKey
in classAbstractMap<String,Object>
-
get
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toString
in classAbstractMap<String,Object>
-
clone
- Overrides:
clone
in classAbstractMap<String,Object>
- Throws:
CloneNotSupportedException
-
clearAndCopy
-
grow
public static <V> V[] grow(V[] array)
-