Class LinkedTreeMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
com.google.gson.internal.LinkedTreeMap<K,V>
All Implemented Interfaces:
Serializable, Map<K,V>

public final class LinkedTreeMap<K,V> extends AbstractMap<K,V> implements Serializable
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 class.

See Also:
  • Constructor Details

    • LinkedTreeMap

      public LinkedTreeMap()
      Create a natural order, empty tree map whose keys must be mutually comparable and non-null, and whose values can be null.
    • LinkedTreeMap

      public LinkedTreeMap(boolean allowNullValues)
      Create a natural order, empty tree map whose keys must be mutually comparable and non-null.
      Parameters:
      allowNullValues - whether null is allowed as entry value
    • LinkedTreeMap

      public LinkedTreeMap(Comparator<? super K> comparator, boolean allowNullValues)
      Create a tree map ordered by comparator. This map's keys may only be null if comparator permits.
      Parameters:
      comparator - the comparator to order elements with, or null to use the natural ordering.
      allowNullValues - whether null is allowed as entry value
  • Method Details