Class 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:
    Serialized Form
    • Constructor Detail

      • LinkedTreeMap

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

        public LinkedTreeMap​(Comparator<? super K> comparator)
        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.