Package de.marhali.json5.internal
Class LinkedTreeMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- de.marhali.json5.internal.LinkedTreeMap<K,V>
-
- All Implemented Interfaces:
java.io.Serializable,java.util.Map<K,V>
public final class LinkedTreeMap<K,V> extends java.util.AbstractMap<K,V> implements java.io.SerializableA map of comparable keys to values. UnlikeTreeMap, 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 Summary
Constructors Constructor Description LinkedTreeMap()Create a natural order, empty tree map whose keys must be mutually comparable and non-null, and whose values can benull.LinkedTreeMap(boolean allowNullValues)Create a natural order, empty tree map whose keys must be mutually comparable and non-null.LinkedTreeMap(java.util.Comparator<? super K> comparator, boolean allowNullValues)Create a tree map ordered bycomparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object key)java.util.Set<java.util.Map.Entry<K,V>>entrySet()Vget(java.lang.Object key)java.util.Set<K>keySet()Vput(K key, V value)Vremove(java.lang.Object key)intsize()-
Methods inherited from class java.util.AbstractMap
clone, containsValue, equals, hashCode, isEmpty, putAll, toString, values
-
-
-
-
Constructor Detail
-
LinkedTreeMap
public LinkedTreeMap()
Create a natural order, empty tree map whose keys must be mutually comparable and non-null, and whose values can benull.
-
LinkedTreeMap
public LinkedTreeMap(boolean allowNullValues)
Create a natural order, empty tree map whose keys must be mutually comparable and non-null.- Parameters:
allowNullValues- whethernullis allowed as entry value
-
LinkedTreeMap
public LinkedTreeMap(java.util.Comparator<? super K> comparator, boolean allowNullValues)
Create a tree map ordered bycomparator. This map's keys may only be null ifcomparatorpermits.- Parameters:
comparator- the comparator to order elements with, ornullto use the natural ordering.allowNullValues- whethernullis allowed as entry value
-
-
Method Detail
-
size
public int size()
-
get
public V get(java.lang.Object key)
-
containsKey
public boolean containsKey(java.lang.Object key)
-
clear
public void clear()
-
remove
public V remove(java.lang.Object key)
-
-