org.jibx.util
Class InsertionOrderedMap

java.lang.Object
  extended by 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
protected static class InsertionOrderedMap.ListSet
          Set implementation backed by a list.
protected  class InsertionOrderedMap.ValueCollection
           
protected  class InsertionOrderedMap.ValueIterator
           
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
InsertionOrderedMap()
           
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set entrySet()
           
 Object get(Object key)
           
 boolean isEmpty()
           
 ArrayList keyList()
          Get list of keys in order added.
 Set keySet()
           
 Object put(Object key, Object value)
           
 void putAll(Map t)
           
 Object remove(Object key)
           
 int size()
           
 Collection values()
           
 
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
equals, hashCode
 

Constructor Detail

InsertionOrderedMap

public InsertionOrderedMap()
Method Detail

clear

public void clear()
Specified by:
clear in interface Map

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map

get

public Object get(Object key)
Specified by:
get in interface Map

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map

keySet

public Set keySet()
Specified by:
keySet in interface Map

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface Map

putAll

public void putAll(Map t)
Specified by:
putAll in interface Map

remove

public Object remove(Object key)
Specified by:
remove in interface Map

size

public int size()
Specified by:
size in interface Map

values

public Collection values()
Specified by:
values in interface Map

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


Copyright © 2005-2011 jibx.org. All Rights Reserved.