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.
  • Field Details

    • m_baseMap

      private final Map m_baseMap
    • m_insertList

      private final ArrayList m_insertList
  • Constructor Details

    • InsertionOrderedMap

      public InsertionOrderedMap()
  • Method Details

    • 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