gnu.trove.decorator
Class TLongByteHashMapDecorator
AbstractMap
gnu.trove.decorator.TLongByteHashMapDecorator
- Cloneable, Map
public class TLongByteHashMapDecorator
extends AbstractMap
implements Map, Cloneable
Wrapper class to make a TLongByteHashMap conform to the
java.util.Map API.
This class simply decorates an underlying TLongByteHashMap 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 TLongByteHashMap | _map - the wrapped primitive map
|
void | clear() - Empties the map.
|
TLongByteHashMapDecorator | 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.
|
Byte | get(Long key) - Retrieves the value for key
|
TLongByteHashMap | getMap() - Returns a reference to the map wrapped by this decorator.
|
boolean | isEmpty() - Indicates whether map has any entries.
|
Byte | put(Long key, Byte value) - Inserts a key/value pair into the map.
|
void | putAll(extends Long, Byte> map) - Copies the key/value mappings in map into this map.
|
Byte | 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 byte | unwrapValue(Object value) - Unwraps a value
|
protected Long | wrapKey(long k) - Wraps a key
|
protected Byte | wrapValue(byte k) - Wraps a value
|
_map
protected TLongByteHashMap _map
the wrapped primitive map
TLongByteHashMapDecorator
public TLongByteHashMapDecorator(TLongByteHashMap map)
Creates a wrapper that decorates the specified primitive map.
clear
public void clear()
Empties the map.
clone
public TLongByteHashMapDecorator 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 Byte get(Long key)
Retrieves the value for key
- the value of key or null if no such mapping exists.
getMap
public TLongByteHashMap getMap()
Returns a reference to the map wrapped by this decorator.
isEmpty
public boolean isEmpty()
Indicates whether map has any entries.
put
public Byte put(Long key,
Byte value)
Inserts a key/value pair into the map.
key
- an Object
valuevalue
- an Object
value
- the previous value associated with key,
or Byte(0) if none was found.
putAll
public void putAll(extends Long,
Byte> 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 Byte remove(Long key)
Deletes a key/value pair from the map.
- the removed value, or Byte(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 byte 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 Byte wrapValue(byte 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.