Package com.google.gson.internal
Class LinkedHashTreeMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
com.google.gson.internal.LinkedHashTreeMap<K,V>
- All Implemented Interfaces:
Serializable
,Map<K,
V>
A map of comparable keys to values. Unlike
TreeMap
, this class uses
insertion order for iteration order. Comparison order is only used as an
optimization for efficient insertion and removal.
This implementation was derived from Android 4.1's TreeMap and LinkedHashMap classes.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionCreate a natural order, empty tree map whose keys must be mutually comparable and non-null.LinkedHashTreeMap
(Comparator<? super K> comparator) Create a tree map ordered bycomparator
. -
Method Summary
Methods inherited from class java.util.AbstractMap
clone, containsValue, equals, hashCode, isEmpty, putAll, toString, 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
-
LinkedHashTreeMap
public LinkedHashTreeMap()Create a natural order, empty tree map whose keys must be mutually comparable and non-null. -
LinkedHashTreeMap
Create a tree map ordered bycomparator
. This map's keys may only be null ifcomparator
permits.- Parameters:
comparator
- the comparator to order elements with, ornull
to use the natural ordering.
-
-
Method Details
-
size
public int size() -
get
-
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V> - Overrides:
containsKey
in classAbstractMap<K,
V>
-
put
-
clear
public void clear() -
remove
-
entrySet
-
keySet
-