|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjautil.MapInt<E>
public class MapInt<E>
A generic map whose conceptual domain type is int,
represented concretely by an integer wrapper class.
By default the underlying Map implementation used is
a TreeMap.
| Nested Class Summary | |
|---|---|
static class |
MapInt.Int
Wrapper class for an integer, acting a MapInt key. |
| Constructor Summary | |
|---|---|
MapInt()
Constructs a new MapInt, using a new TreeMap instance. |
|
MapInt(java.util.Map<MapInt.Int,E> mp)
Constructs a new MapInt using the given Map. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears this map. |
E |
get(int k)
Returns the value to which the given key is mapped, or null
if none. |
static MapInt.Int.Comp |
getIntComp()
Returns a comparator for the built-in integer wrapper class. |
void |
getValues(E[] values)
Places the values in this map in the given array, which should be of the correct size, i.e. |
int[] |
keys()
Returns this map's key set as an array of int. |
void |
put(int key,
E val)
Updates this map with an entry mapping the given key to the given value. |
void |
setMap(java.util.Map<MapInt.Int,E> mp)
Sets the underlying Map for this IntMap. |
int |
size()
Returns the size of this map. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapInt(java.util.Map<MapInt.Int,E> mp)
MapInt using the given Map.
public MapInt()
MapInt, using a new TreeMap instance.
| Method Detail |
|---|
public static final MapInt.Int.Comp getIntComp()
public void setMap(java.util.Map<MapInt.Int,E> mp)
Map for this IntMap.
public void clear()
public int size()
public void put(int key,
E val)
public void getValues(E[] values)
size().
public E get(int k)
null
if none.
public int[] keys()
int.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||