gnu.trove.decorator
Class TObjectLongHashMapDecorator<V>
AbstractMap
gnu.trove.decorator.TObjectLongHashMapDecorator<V>
- Map
public class TObjectLongHashMapDecorator<V>
extends AbstractMap
implements Map
Wrapper class to make a TObjectLongHashMap conform to the
java.util.Map API.
This class simply decorates an underlying TObjectLongHashMap 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 TObjectLongHashMap | _map - the wrapped primitive map
|
void | clear() - Empties the map.
|
TObjectLongHashMapDecorator | 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(Object key) - Retrieves the value for key
|
TObjectLongHashMap | getMap() - Returns a reference to the map wrapped by this decorator.
|
boolean | isEmpty() - Indicates whether map has any entries.
|
Long | put(V key, Long value) - Inserts a key/value pair into the map.
|
void | putAll(extends V, Long> map) - Copies the key/value mappings in map into this map.
|
Long | remove(Object key) - Deletes a key/value pair from the map.
|
int | size() - Returns the number of entries in the map.
|
protected V | unwrapKey(Object key) - Unwraps a key
|
protected long | unwrapValue(Object value) - Unwraps a value
|
protected V | wrapKey(Object o) - Wraps a key
|
protected Long | wrapValue(long k) - Wraps a value
|
_map
protected TObjectLongHashMap _map
the wrapped primitive map
TObjectLongHashMapDecorator
public TObjectLongHashMapDecorator(TObjectLongHashMap map)
Creates a wrapper that decorates the specified primitive map.
clear
public void clear()
Empties the map.
clone
public TObjectLongHashMapDecorator 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(Object key)
Retrieves the value for key
- the value of key or null if no such mapping exists.
getMap
public TObjectLongHashMap 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(V 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 Integer(0) if none was found.
putAll
public void putAll(extends V,
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(Object key)
Deletes a key/value pair from the map.
- the removed value, or Integer(0) if it was not found in the map
size
public int size()
Returns the number of entries in the map.
unwrapKey
protected final V 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 final V wrapKey(Object o)
Wraps a key
o
- 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-2008 Eric D. Friedman. All Rights Reserved.