Package org.jibx.util
Class InsertionOrderedMap
- java.lang.Object
-
- org.jibx.util.InsertionOrderedMap
-
- All Implemented Interfaces:
java.util.Map
public class InsertionOrderedMap extends java.lang.Object implements java.util.MapMap 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
-
Field Summary
Fields Modifier and Type Field Description private java.util.Mapm_baseMapprivate java.util.ArrayListm_insertList
-
Constructor Summary
Constructors Constructor Description InsertionOrderedMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.SetentrySet()java.lang.Objectget(java.lang.Object key)booleanisEmpty()java.util.ArrayListkeyList()Get list of keys in order added.java.util.SetkeySet()java.lang.Objectput(java.lang.Object key, java.lang.Object value)voidputAll(java.util.Map t)java.lang.Objectremove(java.lang.Object key)intsize()java.util.Collectionvalues()
-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKeyin interfacejava.util.Map
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValuein interfacejava.util.Map
-
entrySet
public java.util.Set entrySet()
- Specified by:
entrySetin interfacejava.util.Map
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
getin interfacejava.util.Map
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Map
-
keySet
public java.util.Set keySet()
- Specified by:
keySetin interfacejava.util.Map
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)- Specified by:
putin interfacejava.util.Map
-
putAll
public void putAll(java.util.Map t)
- Specified by:
putAllin interfacejava.util.Map
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
removein interfacejava.util.Map
-
size
public int size()
- Specified by:
sizein interfacejava.util.Map
-
values
public java.util.Collection values()
- Specified by:
valuesin interfacejava.util.Map
-
keyList
public java.util.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
-
-