BRUtil - Making Java a Kinder, Gentler, Place to be.

brutil
Interface Map

All Superinterfaces:
Collection
All Known Subinterfaces:
SortedMap
All Known Implementing Classes:
AbstractMap

public interface Map
extends Collection

Used for associating (key, value) pairs of objects. Pairs (Entries) entered with put(k,v), accessed with get(k), and removed by remove(k). Many possible implementations.


Method Summary
 boolean containsKey(java.lang.Object key)
          Checks to see if the specified key object is in the Map.
 java.lang.Object get(java.lang.Object key)
          Returns the value to which the specified key is mapped in this Map.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Maps the specified key to the specified value in this Map.
 java.lang.Object remove(java.lang.Object key)
          Removes the key (and its corresponding value) from this Map.
 
Methods inherited from interface brutil.Collection
clear, isEmpty, size
 

Method Detail

get

public java.lang.Object get(java.lang.Object key)
Returns the value to which the specified key is mapped in this Map.
Parameters:
key - a key in the Map.
Returns:
the value to which the key is mapped in this Map; null if the key is not mapped to any value in this Map.
See Also:
put(Object, Object)

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Maps the specified key to the specified value in this Map. The key cannot be null.
Parameters:
key - the Map key.
data - the value.
Returns:
the previous value of the specified key in this Map, or null if it did not have one.
Throws:
NullPointerException - if key is null.
See Also:
get(Object)

remove

public java.lang.Object remove(java.lang.Object key)
Removes the key (and its corresponding value) from this Map. This method does nothing if the key is not in the Map.
Parameters:
key - the key that needs to be removed.
Returns:
the value to which the key had been mapped in this Map, or null if the key did not have a mapping.

containsKey

public boolean containsKey(java.lang.Object key)
Checks to see if the specified key object is in the Map.
Parameters:
key - the key to be found.
Returns:
true if the key is in the map.


BRUtil - Making Java a Kinder, Gentler, Place to be.