velosurf.util
Interface MultiMap

All Known Implementing Classes:
HashMultiMap

public interface MultiMap

A MultiMap is a Map allowing multiple occurrences of keys.

Author:
Mark Richters
See Also:
Map

Method Summary
 void clear()
          Removes all mappings from this map (optional operation).
 boolean containsKey(java.lang.Object key)
          Returns true if this multimap contains a mapping for the specified key.
 boolean containsValue(java.lang.Object value)
          Returns true if this multimap maps one or more keys to the specified value.
 boolean equals(java.lang.Object o)
          Compares the specified object with this multimap for equality.
 java.util.List get(java.lang.Object key)
          Returns a list of values to which this multimap maps the specified key.
 int hashCode()
          Returns the hash code value for this map.
 boolean isEmpty()
          Returns true if this multimap contains no mappings.
 java.util.Set keySet()
          Returns a set view of the keys contained in this multimap.
 void put(java.lang.Object key, java.lang.Object value)
          Adds the specified value with the specified key to this multimap.
 void putAll(MultiMap t)
          Copies all entries from the specified multimap to this multimap.
 void remove(java.lang.Object key)
          Removes all mappings for this key from this multimap if present.
 void remove(java.lang.Object key, java.lang.Object value)
          Removes the specified key/value mapping from this multimap if present.
 int size()
          Returns the number of values in this multimap.
 

Method Detail

size

int size()
Returns the number of values in this multimap.


isEmpty

boolean isEmpty()
Returns true if this multimap contains no mappings.


containsKey

boolean containsKey(java.lang.Object key)
Returns true if this multimap contains a mapping for the specified key.

Parameters:
key -
Returns:
a boolean

containsValue

boolean containsValue(java.lang.Object value)
Returns true if this multimap maps one or more keys to the specified value.

Parameters:
value -
Returns:
a boolean

get

java.util.List get(java.lang.Object key)
Returns a list of values to which this multimap maps the specified key.

Parameters:
key -
Returns:
the list of values to which this map maps the specified key, the list may be empty if the multimap contains no mapping for this key.

put

void put(java.lang.Object key,
         java.lang.Object value)
Adds the specified value with the specified key to this multimap.

Parameters:
key -
value -

putAll

void putAll(MultiMap t)
Copies all entries from the specified multimap to this multimap.

Parameters:
t - multimap

remove

void remove(java.lang.Object key)
Removes all mappings for this key from this multimap if present.

Parameters:
key -

remove

void remove(java.lang.Object key,
            java.lang.Object value)
Removes the specified key/value mapping from this multimap if present.

Parameters:
key -
value -

clear

void clear()
Removes all mappings from this map (optional operation).


keySet

java.util.Set keySet()
Returns a set view of the keys contained in this multimap.

Returns:
key set

equals

boolean equals(java.lang.Object o)
Compares the specified object with this multimap for equality.

Overrides:
equals in class java.lang.Object
Parameters:
o - other object
Returns:
a boolean

hashCode

int hashCode()
Returns the hash code value for this map.

Overrides:
hashCode in class java.lang.Object


~ooOoo~