org.exolab.castor.util
Class OrderedHashMap
HashMap
org.exolab.castor.util.OrderedHashMap
public class OrderedHashMap
extends HashMap
A very simple extended HashMap, which maintains order via an ArrayList.
This class provides similar, though not identical, functionality as
the JDK's LinkedHashMap, but works under JDK 1.2 and JDK 1.3.
This class is not synchronized, if more than one thread accesses an
instance of this class and at least one thread modifies the map,
the OrderedHashMap instance must be synchronized via a call to
Collections.synchronizedMap method.
The #entrySet() and #keySet() methods return unmodifiable sets.
The #values() method returns an unmodifiable collection.
$Revision: 6230 $ $Date: 2005-12-13 14:58:48 -0700 (Tue, 13 Dec 2005) $OrderedHashMap() - Creates a new OrderedHashMap
|
OrderedHashMap(Map m) - Creates a new OrderedHashMap with the same entries
as the given map.
|
OrderedHashMap(int initialCapacity) - Creates a new OrderedHashMap with the given initial capacity
|
void | clear()
|
Object | clone()
|
Set | entrySet() - Returns the Map.Entry set for this Map.
|
Set | keySet() - Returns the key set for this Map.
|
Object | put(Object key, Object value)
|
void | putAll(Map m)
|
Object | remove(Object key)
|
Collection | values() - Returns the set of values for this Map.
|
OrderedHashMap
public OrderedHashMap()
Creates a new OrderedHashMap
OrderedHashMap
public OrderedHashMap(Map m)
Creates a new OrderedHashMap with the same entries
as the given map.
m
- the Map to initialize this Map with
OrderedHashMap
public OrderedHashMap(int initialCapacity)
Creates a new OrderedHashMap with the given initial capacity
clone
public Object clone()
entrySet
public Set entrySet()
Returns the Map.Entry set for this Map. Note that the
returned Set is an unmodifiable Set
keySet
public Set keySet()
Returns the key set for this Map. Note that the returned
set is an unmodifiable Set
put
public Object put(Object key,
Object value)
java.util.Map.put(java.lang.Object, java.lang.Object)
putAll
public void putAll(Map m)
java.util.Map.putAll(java.util.Map)
remove
public Object remove(Object key)
java.util.Map.remove(java.lang.Object)
values
public Collection values()
Returns the set of values for this Map. Note that
the returned Collection is unmodifiable.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com