public class TObjectIntHashMapDecorator
extends java.util.AbstractMap
implements java.util.Map
Note that wrapping and unwrapping primitive values is extremely inefficient. If possible, users of this class should override the appropriate methods in this class and use a table of canonical values.
Created: Mon Sep 23 22:07:40 PDT 2002| Modifier and Type | Field and Description |
|---|---|
protected TObjectIntHashMap |
_map
the wrapped primitive map
|
| Constructor and Description |
|---|
TObjectIntHashMapDecorator(TObjectIntHashMap map)
Creates a wrapper that decorates the specified primitive map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Empties the map.
|
boolean |
containsKey(java.lang.Object key)
Checks for the present of key in the keys of the map.
|
boolean |
containsValue(java.lang.Object val)
Checks for the presence of val in the values of the map.
|
java.util.Set |
entrySet()
Returns a Set view on the entries of the map.
|
boolean |
equals(java.lang.Object other)
Compares this map with another map for equality of their stored
entries.
|
java.lang.Object |
get(java.lang.Object key)
Retrieves the value for key
|
boolean |
isEmpty()
Indicates whether map has any entries.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Inserts a key/value pair into the map.
|
void |
putAll(java.util.Map map)
Copies the key/value mappings in map into this map.
|
java.lang.Object |
remove(java.lang.Object key)
Deletes a key/value pair from the map.
|
int |
size()
Returns the number of entries in the map.
|
protected java.lang.Object |
unwrapKey(java.lang.Object key)
Unwraps a key
|
protected int |
unwrapValue(java.lang.Object value)
Unwraps a value
|
protected java.lang.Object |
wrapKey(java.lang.Object o)
Wraps a key
|
protected java.lang.Integer |
wrapValue(int k)
Wraps a value
|
protected final TObjectIntHashMap _map
public TObjectIntHashMapDecorator(TObjectIntHashMap map)
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class java.util.AbstractMapkey - an Object valuevalue - an Object valuepublic boolean equals(java.lang.Object other)
equals in interface java.util.Mapequals in class java.util.AbstractMapother - an Object valuepublic java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapget in class java.util.AbstractMapkey - an Object valuepublic void clear()
clear in interface java.util.Mapclear in class java.util.AbstractMappublic java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapremove in class java.util.AbstractMapkey - an Object valuepublic java.util.Set entrySet()
entrySet in interface java.util.MapentrySet in class java.util.AbstractMapSet valuepublic boolean containsValue(java.lang.Object val)
containsValue in interface java.util.MapcontainsValue in class java.util.AbstractMapval - an Object valueboolean valuepublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.MapcontainsKey in class java.util.AbstractMapkey - an Object valueboolean valuepublic int size()
size in interface java.util.Mapsize in class java.util.AbstractMappublic boolean isEmpty()
isEmpty in interface java.util.MapisEmpty in class java.util.AbstractMappublic void putAll(java.util.Map map)
putAll in interface java.util.MapputAll in class java.util.AbstractMapmap - a Map valueprotected final java.lang.Object wrapKey(java.lang.Object o)
a - key in the underlying mapprotected final java.lang.Object unwrapKey(java.lang.Object key)
a - wrapped keyprotected java.lang.Integer wrapValue(int k)
a - value in the underlying mapprotected int unwrapValue(java.lang.Object value)
a - wrapped value