com.thoughtworks.qdox.model.util
Class OrderedMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by com.thoughtworks.qdox.model.util.OrderedMap
All Implemented Interfaces:
Map

public class OrderedMap
extends AbstractMap

This is a simple Map implementation backed by a List of Map.Entry objects. It has the property that iterators return entries in the order in whick they were inserted. Operations involving searching, including get() and put(), have cost linear to the size of the map. In other words, avoid this implementation if your Map might get large. If we could assume Java 1.4+, we'd just use java.util.LinkedHashMap instead of this class. But we can't.

Author:
Mike Williams

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
OrderedMap()
           
 
Method Summary
 Set entrySet()
           
 Object put(Object key, Object value)
           
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrderedMap

public OrderedMap()
Method Detail

entrySet

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

put

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


Copyright © 2002-2011. All Rights Reserved.