|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
E
- the element type for the values to which the keys are mappedpublic interface IntKeyMap<E>
This is a Map that maps int
s (keys) to Object
s
(values). If the key is given as an Integer
rather than an
int
, it must not be null
. Values are allowed
to be null
.
The idea behind this interface is that the use of int
s as
keys (rather than Integer
objects) should allow for more
efficient (time and memory) implementations of this interface.
Nested Class Summary | |
---|---|
static interface |
IntKeyMap.IntKeyEntry<E>
A node in the Map. |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Method Summary | |
---|---|
boolean |
containsKey(int key)
This function returns true if this IntKeyMap contains a mapping for the specified key, which is an int here. |
E |
get(int key)
This function returns the value to which this IntKeyMap maps the specified key, which is an int here. |
E |
put(int key,
E value)
This function associates the specified key, an int, with the specified value in this IntKeyMap. |
E |
remove(int key)
This function removes the mapping for this key, an int, from this IntKeyMap if it was present. |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Method Detail |
---|
E put(int key, E value)
This function associates the specified key, an int, with the specified
value in this IntKeyMap. If the IntKeyMap previously contained a mapping
for this key, the old value is replaced. The old value is also used as
the return value of this function. A null return may indicate that no
previous association existed or that the IntKeyMap previously associated
null with the specified key (see get(int)
).
key
- the key with which the specified value is to be associatedvalue
- the value to be associated with the specified key
boolean containsKey(int key)
This function returns true if this IntKeyMap contains a mapping for the specified key, which is an int here.
key
- the key whose presence in this IntKeyMap is to be tested
E get(int key)
This function returns the value to which this IntKeyMap maps the
specified key, which is an int here. It returns null if the IntKeyMap
contains no mapping for this key. A return value of null does not
necessarily indicate that the IntKeyMap contains no mapping for
the key; it is also possible that the IntKeyMap explicitly maps the key
to null. The containsKey(int)
operation may be used to
distinguish these two cases.
key
- key whose associated value is to be returned
E remove(int key)
This function removes the mapping for this key, an int, from this
IntKeyMap if it was present. The value the key was mapped to is returned.
A null return may indicate that the IntKeyMap previously associated null
with the specified key (see get(int)
).
key
- the key to the mapping that is to be removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |