|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.starbase.util.collections.SimpleHashMap
A simple implementation of the Map interface that uses a Hashtable as its underlying implementation. This class does support null values.
| Nested Class Summary |
| Nested classes inherited from class com.starbase.util.collections.Map |
Map.Entry |
| Constructor Summary | |
SimpleHashMap()
Constructs a new SimpleHashMap. |
|
SimpleHashMap(int initialCapacity)
Constructs a new SimpleHashMap with the specified
initial capacity and a load factor of 0.75. |
|
SimpleHashMap(int initialCapacity,
float loadFactor)
Constructs a new SimpleHashMap with the specified
initial capacity and load factor. |
|
| 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()
This is currently not implemented. |
java.lang.Object |
get(java.lang.Object key)
Returns the value for the specified key from the map. |
boolean |
isEmpty()
Return true if the map is empty. |
Set |
keySet()
This is currently not implemented. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Asscociates the specified value with the specified key. |
void |
putAll(Map map)
This operation is unsupported and will throw an exception if called. |
java.lang.Object |
remove(java.lang.Object key)
Removes the key from this map. |
int |
size()
Return the number of entries in this map. |
Collection |
values()
This is currently not implemented. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.starbase.util.collections.Map |
equals, hashCode |
| Constructor Detail |
public SimpleHashMap()
SimpleHashMap.
public SimpleHashMap(int initialCapacity)
SimpleHashMap with the specified
initial capacity and a load factor of 0.75.
initialCapacity - the initial capacity of this map.
public SimpleHashMap(int initialCapacity,
float loadFactor)
SimpleHashMap with the specified
initial capacity and load factor.
The load factor specifies how full the underlying
hash table has to get before its capacity is automatically increased.
initialCapacity - the initial capacity of this map.loadFactor - the load factor for the underlying hashtable.| Method Detail |
public int size()
size in interface Mappublic boolean isEmpty()
isEmpty in interface Mappublic boolean containsKey(java.lang.Object key)
containsKey in interface Mapkey - the key being checked for in this map.
public boolean containsValue(java.lang.Object value)
containsValue in interface Mapvalue - the value being checked for in this map
public java.lang.Object get(java.lang.Object key)
get in interface Mapkey - the key used for lookup in this map.
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface Mapkey - the key with which the value is associatedvalue - the value associated with the key (may be null)
public java.lang.Object remove(java.lang.Object key)
remove in interface Mapkey - the key to be removed
public void putAll(Map map)
putAll in interface Mapmap - the mappings to be stored in this mappublic void clear()
clear in interface Mappublic Set keySet()
keySet in interface MapUnsupportedOperationException - alwayspublic Collection values()
values in interface MapUnsupportedOperationException - alwayspublic Set entrySet()
entrySet in interface MapUnsupportedOperationException - always
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||