gnu.trove.decorator
Class TLongLongHashMapDecorator
AbstractMap
gnu.trove.decorator.TLongLongHashMapDecorator
- Cloneable, Map
public class TLongLongHashMapDecorator
extends AbstractMap
implements Map, Cloneable
Wrapper class to make a TLongLongHashMap conform to the
java.util.Map API.
This class simply decorates an underlying TLongLongHashMap 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
protected TLongLongHashMap | _map - the wrapped primitive map
|
void | clear() - Empties the map.
|
TLongLongHashMapDecorator | clone() - Clones the underlying trove collection and returns the clone wrapped in a new
decorator instance.
|
boolean | containsKey(Object key) - Checks for the present of key in the keys of the map.
|
boolean | containsValue(Object val) - Checks for the presence of val in the values of the map.
|
Set> | entrySet() - Returns a Set view on the entries of the map.
|
boolean | equals(Object other) - Compares this map with another map for equality of their stored
entries.
|
Long | get(Long key) - Retrieves the value for key
|
TLongLongHashMap | getMap() - Returns a reference to the map wrapped by this decorator.
|
boolean | isEmpty() - Indicates whether map has any entries.
|
Long | put(Long key, Long value) - Inserts a key/value pair into the map.
|
void | putAll(extends Long, Long> map) - Copies the key/value mappings in map into this map.
|
Long | remove(Long key) - Deletes a key/value pair from the map.
|
int | size() - Returns the number of entries in the map.
|
protected long | unwrapKey(Object key) - Unwraps a key
|
protected long | unwrapValue(Object value) - Unwraps a value
|
protected Long | wrapKey(long k) - Wraps a key
|
protected Long | wrapValue(long k) - Wraps a value
|
_map
protected TLongLongHashMap _map
the wrapped primitive map
TLongLongHashMapDecorator
public TLongLongHashMapDecorator(TLongLongHashMap map)
Creates a wrapper that decorates the specified primitive map.
clear
public void clear()
Empties the map.
clone
public TLongLongHashMapDecorator clone()
Clones the underlying trove collection and returns the clone wrapped in a new
decorator instance. This is a shallow clone except where primitives are
concerned.
containsKey
public boolean containsKey(Object key)
Checks for the present of key in the keys of the map.
containsValue
public boolean containsValue(Object val)
Checks for the presence of val in the values of the map.
entrySet
public Set> entrySet()
Returns a Set view on the entries of the map.
equals
public boolean equals(Object other)
Compares this map with another map for equality of their stored
entries.
- true if the maps are identical
get
public Long get(Long key)
Retrieves the value for key
- the value of key or null if no such mapping exists.
getMap
public TLongLongHashMap getMap()
Returns a reference to the map wrapped by this decorator.
isEmpty
public boolean isEmpty()
Indicates whether map has any entries.
put
public Long put(Long key,
Long value)
Inserts a key/value pair into the map.
key
- an Object
valuevalue
- an Object
value
- the previous value associated with key,
or Long(0) if none was found.
putAll
public void putAll(extends Long,
Long> map)
Copies the key/value mappings in map into this map.
Note that this will be a deep copy, as storage is by
primitive value.
remove
public Long remove(Long key)
Deletes a key/value pair from the map.
- the removed value, or Long(0) if it was not found in the map
size
public int size()
Returns the number of entries in the map.
unwrapKey
protected long unwrapKey(Object key)
Unwraps a key
- an unwrapped representation of the key
unwrapValue
protected long unwrapValue(Object value)
Unwraps a value
- an unwrapped representation of the value
wrapKey
protected Long wrapKey(long k)
Wraps a key
k
- key in the underlying map
- an Object representation of the key
wrapValue
protected Long wrapValue(long k)
Wraps a value
k
- value in the underlying map
- an Object representation of the value
GNU Trove is copyright B) 2001-2007 Eric D. Friedman. All Rights Reserved.