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