|
GNU Trove | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractMap | +--gnu.trove.decorator.TDoubleLongHashMapDecorator
Wrapper class to make a TDoubleLongHashMap conform to the java.util.Map API. This class simply decorates an underlying TDoubleLongHashMap 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
Field Summary | |
protected TDoubleLongHashMap |
_map
the wrapped primitive map |
Constructor Summary | |
TDoubleLongHashMapDecorator(TDoubleLongHashMap map)
Creates a wrapper that decorates the specified primitive map. |
Method Summary | |
void |
clear()
Empties the map. |
java.lang.Object |
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 |
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 double |
unwrapKey(java.lang.Object key)
Unwraps a key |
protected long |
unwrapValue(java.lang.Object value)
Unwraps a value |
protected java.lang.Double |
wrapKey(double k)
Wraps a key |
protected java.lang.Long |
wrapValue(long k)
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 TDoubleLongHashMap _map
Constructor Detail |
public TDoubleLongHashMapDecorator(TDoubleLongHashMap map)
Method Detail |
public java.lang.Object clone()
clone
in class java.util.AbstractMap
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
put
in class java.util.AbstractMap
key
- an Object
valuevalue
- an Object
value
public boolean equals(java.lang.Object other)
equals
in interface java.util.Map
equals
in class java.util.AbstractMap
other
- an Object
value
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
get
in class java.util.AbstractMap
key
- an Object
value
public void clear()
clear
in interface java.util.Map
clear
in class java.util.AbstractMap
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
remove
in class java.util.AbstractMap
key
- an Object
value
public java.util.Set entrySet()
entrySet
in interface java.util.Map
entrySet
in class java.util.AbstractMap
Set
valuepublic boolean containsValue(java.lang.Object val)
containsValue
in interface java.util.Map
containsValue
in class java.util.AbstractMap
val
- an Object
value
boolean
valuepublic boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
containsKey
in class java.util.AbstractMap
key
- an Object
value
boolean
valuepublic int size()
size
in interface java.util.Map
size
in class java.util.AbstractMap
public boolean isEmpty()
isEmpty
in interface java.util.Map
isEmpty
in class java.util.AbstractMap
public void putAll(java.util.Map map)
putAll
in interface java.util.Map
putAll
in class java.util.AbstractMap
map
- a Map
valueprotected java.lang.Double wrapKey(double k)
protected double unwrapKey(java.lang.Object key)
protected java.lang.Long wrapValue(long k)
protected long unwrapValue(java.lang.Object value)
|
GNU Trove | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |