Methods Summary |
---|
public void | clear()Remove all mappings from this map.
// --------------------------------------------------------- Public Methods
synchronized (this) {
HashMap temp = (HashMap) map.clone();
temp.clear();
map = temp;
}
|
public java.lang.Object | clone()Return a shallow copy of this FastHashMap instance.
The keys and values themselves are not copied.
return new FastHashMap(map);
|
public boolean | containsKey(java.lang.Object key)Return true if this map contains a mapping for the
specified key.
return map.containsKey(key);
|
public boolean | containsValue(java.lang.Object value)Return true if this map contains one or more keys mapping
to the specified value.
return map.containsValue(value);
|
public java.util.Set | entrySet()Return a collection view of the mappings contained in this map. Each
element in the returned collection is a Map.Entry .
return map.entrySet();
|
public boolean | equals(java.lang.Object o)Compare the specified object with this list for equality. This
implementation uses exactly the code that is used to define the
list equals function in the documentation for the
Map.equals method.
// Simple tests that require no synchronization
if (o == this)
return true;
else if ( !(o instanceof Map) )
return false;
Map mo = (Map) o;
// Compare the two maps for equality
if ( mo.size() != map.size() )
return false;
java.util.Iterator i = map.entrySet().iterator();
while ( i.hasNext() ) {
Map.Entry e = (Map.Entry) i.next();
Object key = e.getKey();
Object value = e.getValue();
if (value == null) {
if ( !( mo.get(key) == null && mo.containsKey(key) ) )
return false;
}
else {
if ( !value.equals( mo.get(key) ) )
return false;
}
}
return true;
|
public java.lang.Object | get(java.lang.Object key)Return the value to which this map maps the specified key. Returns
null if the map contains no mapping for this key, or if
there is a mapping with a value of null . Use the
containsKey() method to disambiguate these cases.
return map.get(key);
|
public int | hashCode()Return the hash code value for this map. This implementation uses
exactly the code that is used to define the list hash function in the
documentation for the Map.hashCode method.
int h = 0;
java.util.Iterator i = map.entrySet().iterator();
while ( i.hasNext() )
h += i.next().hashCode();
return h;
|
public boolean | isEmpty()Return true if this map contains no mappings.
return map.isEmpty();
|
public java.util.Set | keySet()Return a set view of the keys contained in this map.
return map.keySet();
|
public java.lang.Object | put(java.lang.Object key, java.lang.Object value)Associate the specified value with the specified key in this map.
If the map previously contained a mapping for this key, the old
value is replaced and returned.
synchronized (this) {
HashMap temp = (HashMap) map.clone();
Object result = temp.put(key, value);
map = temp;
return (result);
}
|
public void | putAll(java.util.Map in)Copy all of the mappings from the specified map to this one, replacing
any mappings with the same keys.
synchronized (this) {
HashMap temp = (HashMap) map.clone();
temp.putAll(in);
map = temp;
}
|
public java.lang.Object | remove(java.lang.Object key)Remove any mapping for this key, and return any previously
mapped value.
synchronized (this) {
HashMap temp = (HashMap) map.clone();
Object result = temp.remove(key);
map = temp;
return (result);
}
|
public int | size()Return the number of key-value mappings in this map.
return map.size();
|
public java.lang.String | toString() return map.toString();
|
public java.util.Collection | values()Return a collection view of the values contained in this map.
return map.values();
|