ewe.util
Interface Map

All Known Implementing Classes:
Hashtable

public interface Map

A Map is a collection that maps a key to a value. A Hashtable is an instance of a Map.


Nested Class Summary
static interface Map.MapEntry
           
 
Method Summary
 void clear()
          Remove all entries in the Map.
 boolean containsKey(Object key)
          Checks if an entry with the specified key is in the Map.
 boolean containsValue(Object value)
          Checks if at least one entry with the specified value is in the Map.
 Iterator entries()
          Provides an Iterator to iterate through all the entries.
 Object get(Object key)
          Get the object with the specified key.
 Object put(Object key, Object value)
          Put the object and key in the Map.
 Object remove(Object key)
          Remove the object and key pair from the Map.
 int size()
          Get the number of entries in the Map.
 

Method Detail

entries

public Iterator entries()
Provides an Iterator to iterate through all the entries. Each object returned by the iterator will be a Map.MapEntry object.

Returns:
An Iterator to iterate through all the entries.

size

public int size()
Get the number of entries in the Map.

Returns:
The number of entries in the Map.

clear

public void clear()
Remove all entries in the Map.


containsKey

public boolean containsKey(Object key)
Checks if an entry with the specified key is in the Map.

Parameters:
key - The key to look for.
Returns:
true if the key is in the Map.

containsValue

public boolean containsValue(Object value)
Checks if at least one entry with the specified value is in the Map.

Parameters:
value - The value to look for.
Returns:
true if the value is in the Map at least once.

get

public Object get(Object key)
Get the object with the specified key.

Parameters:
key - The key to look for.
Returns:
The object associated with the key or null if there is no matching key.

put

public Object put(Object key,
                  Object value)
Put the object and key in the Map. Any old entry with the same key will be replaced.

Parameters:
key - The key for the object.
value - The object to put
Returns:
The same as value.

remove

public Object remove(Object key)
Remove the object and key pair from the Map.

Parameters:
key - The key for the Object to replace.
Returns:
The value for the key that was removed if it was in the Map.