| Method from org.hibernate.util.FastHashMap Detail: |
public void clear() {
// --------------------------------------------------------- Public Methods
synchronized (this) {
HashMap temp = (HashMap) map.clone();
temp.clear();
map = temp;
}
}
Remove all mappings from this map. |
public Object clone() {
return new FastHashMap(map);
}
Return a shallow copy of this FastHashMap instance.
The keys and values themselves are not copied. |
public boolean containsKey(Object key) {
return map.containsKey(key);
}
Return true if this map contains a mapping for the
specified key. |
public boolean containsValue(Object value) {
return map.containsValue(value);
}
Return true if this map contains one or more keys mapping
to the specified value. |
public Set entrySet() {
return map.entrySet();
}
Return a collection view of the mappings contained in this map. Each
element in the returned collection is a Map.Entry. |
public boolean equals(Object o) {
// 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;
}
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. |
public Object get(Object key) {
return map.get(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. |
public int hashCode() {
int h = 0;
java.util.Iterator i = map.entrySet().iterator();
while ( i.hasNext() )
h += i.next().hashCode();
return h;
}
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. |
public boolean isEmpty() {
return map.isEmpty();
}
Return true if this map contains no mappings. |
public Set keySet() {
return map.keySet();
}
Return a set view of the keys contained in this map. |
public Object put(Object key,
Object value) {
synchronized (this) {
HashMap temp = (HashMap) map.clone();
Object result = temp.put(key, value);
map = temp;
return (result);
}
}
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. |
public void putAll(Map in) {
synchronized (this) {
HashMap temp = (HashMap) map.clone();
temp.putAll(in);
map = temp;
}
}
Copy all of the mappings from the specified map to this one, replacing
any mappings with the same keys. |
public Object remove(Object key) {
synchronized (this) {
HashMap temp = (HashMap) map.clone();
Object result = temp.remove(key);
map = temp;
return (result);
}
}
Remove any mapping for this key, and return any previously
mapped value. |
public int size() {
return map.size();
}
Return the number of key-value mappings in this map. |
public String toString() {
return map.toString();
}
|
public Collection values() {
return map.values();
}
Return a collection view of the values contained in this map. |