net.infonode.util.collection.map
Class MapAdapter

java.lang.Object
  extended by net.infonode.util.collection.map.MapAdapter
All Implemented Interfaces:
Collection, ConstCollection, ConstMap, Map

public class MapAdapter
extends java.lang.Object
implements Map


Nested Class Summary
private static class MapAdapter.Iterator
           
 
Field Summary
private  java.util.HashMap map
           
 
Constructor Summary
MapAdapter()
           
MapAdapter(java.util.HashMap map)
           
 
Method Summary
 void clear()
          Removes all elements from this collection..
 ConstMapIterator constIterator()
          Returns an iterator for this map.
 boolean containsKey(java.lang.Object key)
          Returns true if this map contains the key.
 boolean containsValue(java.lang.Object value)
          Returns true if this map contains the value.
 java.lang.Object get(java.lang.Object key)
          Returns the value associated with the key.
 boolean isEmpty()
          Returns true if this collection is empty.
 MapIterator iterator()
          Returns an iterator for this map.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Associate a key with a value.
 java.lang.Object remove(java.lang.Object key)
          Removes a key and it's value.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

private java.util.HashMap map
Constructor Detail

MapAdapter

public MapAdapter()

MapAdapter

public MapAdapter(java.util.HashMap map)
Method Detail

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Description copied from interface: Map
Associate a key with a value. This will overwrite any existing association.

Specified by:
put in interface Map
Parameters:
key - the key
value - the value
Returns:
the old value associated with this key, null if no value existed

remove

public java.lang.Object remove(java.lang.Object key)
Description copied from interface: Map
Removes a key and it's value.

Specified by:
remove in interface Map
Parameters:
key - the key
Returns:
the value associated with the key, null if no value existed

clear

public void clear()
Description copied from interface: Collection
Removes all elements from this collection..

Specified by:
clear in interface Collection

iterator

public MapIterator iterator()
Description copied from interface: Map
Returns an iterator for this map.

Specified by:
iterator in interface Map
Returns:
an iterator for this map

get

public java.lang.Object get(java.lang.Object key)
Description copied from interface: ConstMap
Returns the value associated with the key.

Specified by:
get in interface ConstMap
Parameters:
key - the key
Returns:
the value associated with the key, null if no value is associated with the key

containsKey

public boolean containsKey(java.lang.Object key)
Description copied from interface: ConstMap
Returns true if this map contains the key.

Specified by:
containsKey in interface ConstMap
Parameters:
key - the key
Returns:
true if this map contains the key

containsValue

public boolean containsValue(java.lang.Object value)
Description copied from interface: ConstMap
Returns true if this map contains the value.

Specified by:
containsValue in interface ConstMap
Parameters:
value - the value
Returns:
true if this map contains the value

isEmpty

public boolean isEmpty()
Description copied from interface: ConstCollection
Returns true if this collection is empty.

Specified by:
isEmpty in interface ConstCollection
Returns:
true if this collection is empty

constIterator

public ConstMapIterator constIterator()
Description copied from interface: ConstMap
Returns an iterator for this map.

Specified by:
constIterator in interface ConstMap
Returns:
an iterator for this map

size

public int size()