henplus.util
Class ListMap

java.lang.Object
  extended by henplus.util.ListMap
All Implemented Interfaces:
Serializable, Map

public final class ListMap
extends Object
implements Map, Serializable

This provides the functionality of LinkedHashMap. However, that Collection became available at 1.4. So provide this for backward compatibility.

Author:
Martin Grotzke
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
ListMap()
           
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set entrySet()
           
 boolean equals(Object o)
           
 Object get(Object key)
           
 boolean isEmpty()
           
 List keys()
          Returns a List containing all keys.
 Set keySet()
           
 ListIterator keysListIterator()
          Returns a ListIterator over the keys.
 Object put(Object key, Object value)
           
 void putAll(Map t)
           
 Object remove(Object key)
           
 int size()
           
 String toString()
           
 Collection values()
          Returns the values as a Collection, as defined in java.util.Map.
 List valuesList()
          Returns the values as a List.
 ListIterator valuesListIterator()
          Returns a ListIterator over the values.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
hashCode
 

Constructor Detail

ListMap

public ListMap()
Method Detail

size

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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty 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

get

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

put

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

remove

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

putAll

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

clear

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

keySet

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

keys

public List keys()
Returns a List containing all keys.

Returns:
a List containing all keys.

keysListIterator

public ListIterator keysListIterator()
Returns a ListIterator over the keys. Use this method instead of combining the keySet with it's iterator method.


values

public Collection values()
Returns the values as a Collection, as defined in java.util.Map.

Specified by:
values in interface Map

valuesList

public List valuesList()
Returns the values as a List.


valuesListIterator

public ListIterator valuesListIterator()
Returns a ListIterator over the values.


entrySet

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

equals

public boolean equals(Object o)
Specified by:
equals in interface Map
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


? 1997..2006 Henner Zeller