Package groovy.json.internal

# Class LazyMap

java.lang.Object
java.util.AbstractMap<String,Object>
groovy.json.internal.LazyMap

All Implemented Interfaces:
  `Map<String,Object>`

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.

Author:
  Rick Hightower

## Nested Class Summary

## Nested classes/interfaces inherited from class java.util.AbstractMap

`AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

## Nested classes/interfaces inherited from interface java.util.Map

`Map.Entry<K,V>`

## Constructor Summary

Constructors
Constructor
Description
`LazyMap()`
`LazyMap(int initialSize)`

## 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

public Object put(String key, Object value)

Specified by:
  `put` in interface `Map<String,Object>`
Overrides:
  `put` in class `AbstractMap<String,Object>`

### entrySet

public Set<Map.Entry<String,Object>> entrySet()

Specified by:
  `entrySet` in interface `Map<String,Object>`
Specified by:
  `entrySet` in class `AbstractMap<String,Object>`

### size

public int size()

Specified by:
  `size` in interface `Map<String,Object>`
Overrides:
  `size` in class `AbstractMap<String,Object>`

### isEmpty

public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Map<String,Object>`
Overrides:
  `isEmpty` in class `AbstractMap<String,Object>`

### containsValue

public boolean containsValue(Object value)

Specified by:
  `containsValue` in interface `Map<String,Object>`
Overrides:
  `containsValue` in class `AbstractMap<String,Object>`

### containsKey

public boolean containsKey(Object key)

Specified by:
  `containsKey` in interface `Map<String,Object>`
Overrides:
  `containsKey` in class `AbstractMap<String,Object>`

### get

public Object get(Object key)

Specified by:
  `get` in interface `Map<String,Object>`
Overrides:
  `get` in class `AbstractMap<String,Object>`

### remove

public Object remove(Object key)

Specified by:
  `remove` in interface `Map<String,Object>`
Overrides:
  `remove` in class `AbstractMap<String,Object>`

### putAll

public void putAll(Map m)

Specified by:
  `putAll` in interface `Map<String,Object>`
Overrides:
  `putAll` in class `AbstractMap<String,Object>`

### clear

public void clear()

Specified by:
  `clear` in interface `Map<String,Object>`
Overrides:
  `clear` in class `AbstractMap<String,Object>`

### keySet

public Set<String> keySet()

Specified by:
  `keySet` in interface `Map<String,Object>`
Overrides:
  `keySet` in class `AbstractMap<String,Object>`

### values

public Collection<Object> values()

Specified by:
  `values` in interface `Map<String,Object>`
Overrides:
  `values` in class `AbstractMap<String,Object>`

### equals

public boolean equals(Object o)

Specified by:
  `equals` in interface `Map<String,Object>`
Overrides:
  `equals` in class `AbstractMap<String,Object>`

### hashCode

public int hashCode()

Specified by:
  `hashCode` in interface `Map<String,Object>`
Overrides:
  `hashCode` in class `AbstractMap<String,Object>`

### toString

public String toString()

Overrides:
  `toString` in class `AbstractMap<String,Object>`

### clone

protected Object clone() throws CloneNotSupportedException

Overrides:
  `clone` in class `AbstractMap<String,Object>`
Throws:
  `CloneNotSupportedException`

### clearAndCopy

public LazyMap clearAndCopy()

### grow

public static <V> V[] grow(V[] array)