Package org.jibx.util
Class InsertionOrderedMap
- java.lang.Object
-
- org.jibx.util.InsertionOrderedMap
-
- All Implemented Interfaces:
Map
public class InsertionOrderedMap extends Object implements Map
Map with keys iterated in insertion order. This is similar to the Java 1.4 java.util.LinkedHashMap class, but compatible with earlier JVM versions. It also guarantees insertion ordering only for iterating through the key values, not for other iterations. This implementation is optimized for insert-only maps.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classInsertionOrderedMap.ListSetSet implementation backed by a list.protected classInsertionOrderedMap.ValueCollectionprotected classInsertionOrderedMap.ValueIterator
-
Constructor Summary
Constructors Constructor Description InsertionOrderedMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)SetentrySet()Objectget(Object key)booleanisEmpty()ArrayListkeyList()Get list of keys in order added.SetkeySet()Objectput(Object key, Object value)voidputAll(Map t)Objectremove(Object key)intsize()Collectionvalues()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap
-
values
public Collection values()
-
keyList
public ArrayList keyList()
Get list of keys in order added. The returned list is live, and will grow or shrink as pairs are added to or removed from the map.- Returns:
- key list
-
-