|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bak.pcj.adapter.LongKeyIntMapToMapAdapter
This class represents adapters of primitive maps from long values to int values to Java Collections Framework maps. The adapter is implemented as a wrapper around a primitive map. Thus, changes to the underlying map are reflected by this map and vice versa.
LongKeyIntMap
,
Map
Field Summary | |
protected LongKeyIntMap |
map
The underlying primitive map. |
Constructor Summary | |
LongKeyIntMapToMapAdapter(LongKeyIntMap map)
Creates a new adaption of a primitive map of long keys and int values to a Java Collections Framework map. |
Method Summary | |
void |
clear()
Clears this map. |
boolean |
containsKey(Object key)
Indicates whether this map contains a mapping from a specified key. |
boolean |
containsValue(Object value)
Indicates whether this map contains a mapping to a specified value. |
Set |
entrySet()
Returns a set view of the entries of this map. |
boolean |
equals(Object obj)
Indicates whether this map is equal to some object. |
Object |
get(Object key)
Maps a specified key to a value. |
int |
hashCode()
Returns a hash code value for this map. |
boolean |
isEmpty()
Indicates whether this map is empty. |
Set |
keySet()
Returns a set view of the keys of this map. |
Object |
put(Object key,
Object value)
Adds a mapping from a specified key to a specified value to this map. |
void |
putAll(Map map)
Adds all mappings from a specified map to this map. |
Object |
remove(Object key)
Removes the mapping from a specified key from this map. |
int |
size()
Returns the size of this map. |
Collection |
values()
Returns a collection view of the values in this map. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected LongKeyIntMap map
Constructor Detail |
public LongKeyIntMapToMapAdapter(LongKeyIntMap map) throws NullPointerException
map
- the underlying primitive map.
NullPointerException
- if map is null.Method Detail |
public void clear()
clear
in interface Map
UnsupportedOperationException
- if the operation is not supported by the
underlying map.public boolean containsKey(Object key) throws NullPointerException, ClassCastException
containsKey
in interface Map
key
- the key to test for.
NullPointerException
- if key is null.
ClassCastException
- if key is not of class Long
.public boolean containsValue(Object value)
Note that this map can never contain null
values or values of other classes than Integer
.
In those cases, this method will return false.
containsValue
in interface Map
value
- the value to test for.
public Set entrySet()
java.util.Map.Entry
.
entrySet
in interface Map
public boolean equals(Object obj)
equals
in interface Map
obj
- the object with which to compare this map.
public Object get(Object key) throws NullPointerException, ClassCastException
Integer
.
get
in interface Map
key
- the key to map to a value.
NullPointerException
- if key is null.
ClassCastException
- if key is not of class Long
.public int hashCode()
hashCode
in interface Map
public boolean isEmpty()
isEmpty
in interface Map
public Set keySet()
Long
.
keySet
in interface Map
public Object put(Object key, Object value) throws NullPointerException, ClassCastException
put
in interface Map
key
- the key of the mapping to add to this map.value
- the value of the mapping to add to this map.
UnsupportedOperationException
- if the operation is not supported by this map.
NullPointerException
- if key is null;
if value is null.
ClassCastException
- if key is not of class Long
;
if value is not of class Integer
.public void putAll(Map map) throws NullPointerException, ClassCastException
putAll
in interface Map
map
- the map whose mappings to add to this map.
NullPointerException
- if map is null.
UnsupportedOperationException
- if the operation is not supported by this map.
NullPointerException
- if a key in map is null;
if a value in map is null.
ClassCastException
- if a key in map is not of class Long
;
if a value in value is not of class Integer
.public Object remove(Object key)
remove
in interface Map
key
- the key whose mapping to remove from this map.
UnsupportedOperationException
- if the operation is not supported by the
underlying map.public int size()
size
in interface Map
public Collection values()
Integer
.
values
in interface Map
|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |