|
GNU Trove | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<java.lang.Double,V>
gnu.trove.decorator.TDoubleObjectHashMapDecorator<V>
public class TDoubleObjectHashMapDecorator<V>
Wrapper class to make a TDoubleObjectHashMap conform to the java.util.Map API. This class simply decorates an underlying TDoubleObjectHashMap and translates the Object-based APIs into their Trove primitive analogs.
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
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Field Summary | |
|---|---|
protected TDoubleObjectHashMap<V> |
_map
the wrapped primitive map |
| Constructor Summary | |
|---|---|
TDoubleObjectHashMapDecorator(TDoubleObjectHashMap<V> map)
Creates a wrapper that decorates the specified primitive map. |
|
| Method Summary | |
|---|---|
void |
clear()
Empties the map. |
TDoubleObjectHashMapDecorator |
clone()
Clones the underlying trove collection and returns the clone wrapped in a new decorator instance. |
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<java.util.Map.Entry<java.lang.Double,V>> |
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. |
V |
get(java.lang.Object key)
Retrieves the value for key |
TDoubleObjectHashMap<V> |
getMap()
Returns a reference to the map wrapped by this decorator. |
boolean |
isEmpty()
Indicates whether map has any entries. |
V |
put(java.lang.Double key,
V value)
Inserts a key/value pair into the map. |
void |
putAll(java.util.Map<? extends java.lang.Double,? extends V> map)
Copies the key/value mappings in map into this map. |
V |
remove(java.lang.Object key)
Deletes a key/value pair from the map. |
int |
size()
Returns the number of entries in the map. |
protected double |
unwrapKey(java.lang.Object key)
Unwraps a key |
protected V |
unwrapValue(V value)
Unwraps a value |
protected java.lang.Double |
wrapKey(double k)
Wraps a key |
protected V |
wrapValue(V o)
Wraps a value |
| Methods inherited from class java.util.AbstractMap |
|---|
hashCode, keySet, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
hashCode, keySet, values |
| Field Detail |
|---|
protected TDoubleObjectHashMap<V> _map
| Constructor Detail |
|---|
public TDoubleObjectHashMapDecorator(TDoubleObjectHashMap<V> map)
| Method Detail |
|---|
public TDoubleObjectHashMap<V> getMap()
public TDoubleObjectHashMapDecorator clone()
clone in class java.util.AbstractMap<java.lang.Double,V>
public V put(java.lang.Double key,
V value)
put in interface java.util.Map<java.lang.Double,V>put in class java.util.AbstractMap<java.lang.Double,V>key - an Object valuevalue - an Object value
public boolean equals(java.lang.Object other)
equals in interface java.util.Map<java.lang.Double,V>equals in class java.util.AbstractMap<java.lang.Double,V>other - an Object value
public V get(java.lang.Object key)
get in interface java.util.Map<java.lang.Double,V>get in class java.util.AbstractMap<java.lang.Double,V>key - an Object value
public void clear()
clear in interface java.util.Map<java.lang.Double,V>clear in class java.util.AbstractMap<java.lang.Double,V>public V remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Double,V>remove in class java.util.AbstractMap<java.lang.Double,V>key - an Object value
public java.util.Set<java.util.Map.Entry<java.lang.Double,V>> entrySet()
entrySet in interface java.util.Map<java.lang.Double,V>entrySet in class java.util.AbstractMap<java.lang.Double,V>Set valuepublic boolean containsValue(java.lang.Object val)
containsValue in interface java.util.Map<java.lang.Double,V>containsValue in class java.util.AbstractMap<java.lang.Double,V>val - an Object value
boolean valuepublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Double,V>containsKey in class java.util.AbstractMap<java.lang.Double,V>key - an Object value
boolean valuepublic int size()
size in interface java.util.Map<java.lang.Double,V>size in class java.util.AbstractMap<java.lang.Double,V>public boolean isEmpty()
isEmpty in interface java.util.Map<java.lang.Double,V>isEmpty in class java.util.AbstractMap<java.lang.Double,V>public void putAll(java.util.Map<? extends java.lang.Double,? extends V> map)
putAll in interface java.util.Map<java.lang.Double,V>putAll in class java.util.AbstractMap<java.lang.Double,V>map - a Map valueprotected java.lang.Double wrapKey(double k)
k - key in the underlying map
protected double unwrapKey(java.lang.Object key)
key - wrapped key
protected final V wrapValue(V o)
o - value in the underlying map
protected final V unwrapValue(V value)
value - wrapped value
|
GNU Trove | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||