com.starbase.util.collections
Interface Map

All Known Implementing Classes:
SimpleHashMap

public interface Map

This interface is intended to parallel the JDK 1.2 Map interface. A Map is much like a hash table in which it stores key/value pairs. Please see the JDK 1.2 documenation for further details.


Nested Class Summary
static interface Map.Entry
          An interface representing entries in a map.
 
Method Summary
 void clear()
          Removes all mappings stored in this map (optional operation).
 boolean containsKey(java.lang.Object key)
          Returns true if the specified key is contained in this map.
 boolean containsValue(java.lang.Object value)
          Returns true if the specified value is contained in this map.
 Set entrySet()
          Returns a set representation of the map entries in this set.
 boolean equals(java.lang.Object o)
          Returns true of the specified object equals this map.
 java.lang.Object get(java.lang.Object key)
          Returns the value for the specified key from the map.
 int hashCode()
          Returns a hash code for this map.
 boolean isEmpty()
          Return true if the map is empty.
 Set keySet()
          Returns a set representation of all the keys in this map.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Asscociates the specified value with the specified key (option operation).
 void putAll(Map map)
          Copies all of the mapping from the specified map in to this map (optional operation).
 java.lang.Object remove(java.lang.Object key)
          Removes the key from this map (optional operation).
 int size()
          Return the number of entries in this map.
 Collection values()
          Returns a collection of all the values contained in this map.
 

Method Detail

size

public int size()
Return the number of entries in this map.

Returns:
the number of entries in this map.

isEmpty

public boolean isEmpty()
Return true if the map is empty.

Returns:
true if the map is empty.

containsKey

public boolean containsKey(java.lang.Object key)
Returns true if the specified key is contained in this map.

Parameters:
key - the key being checked for in this map.
Returns:
true if the specified key is contained in this map.

containsValue

public boolean containsValue(java.lang.Object value)
Returns true if the specified value is contained in this map. That is ther must be an entry in the map for which a key maps to this value.

Parameters:
value - the value being checked for in this map
Returns:
true if the specified value is contained in this map.

get

public java.lang.Object get(java.lang.Object key)
Returns the value for the specified key from the map.

Parameters:
key - the key used for lookup in this map.
Returns:
the value for the specified key from the map.

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Asscociates the specified value with the specified key (option operation).

Parameters:
key - the key with which the value is associated
value - the value associated with the key
Returns:
the previously associated value with the specified key or null if there was no mapping for the key

remove

public java.lang.Object remove(java.lang.Object key)
Removes the key from this map (optional operation).

Parameters:
key - the key to be removed
Returns:
the value that was associated with the key

putAll

public void putAll(Map map)
Copies all of the mapping from the specified map in to this map (optional operation).

Parameters:
map - the mappings to be stored in this map

clear

public void clear()
Removes all mappings stored in this map (optional operation).


keySet

public Set keySet()
Returns a set representation of all the keys in this map.

Returns:
the set of keys contained in this map

values

public Collection values()
Returns a collection of all the values contained in this map.

Returns:
a collection of all the values contained in this map.

entrySet

public Set entrySet()
Returns a set representation of the map entries in this set. Each element of the set is a Map.Entry,

Returns:
a set representation of the map entry in this set.

equals

public boolean equals(java.lang.Object o)
Returns true of the specified object equals this map.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to be compared to
Returns:
true of the specified object equals this map.

hashCode

public int hashCode()
Returns a hash code for this map.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this map.


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.