public class IntToFloatMap extends Object
Modifier and Type | Field and Description |
---|---|
static float |
GROUND |
Constructor and Description |
---|
IntToFloatMap()
Constructs a map with default capacity.
|
IntToFloatMap(int capacity)
Constructs a map with given capacity.
|
Modifier and Type | Method and Description |
---|---|
protected int |
calcBaseHashIndex(int key)
Calculating the baseHash index using the internal
hashFactor
. |
void |
clear()
Empties the map.
|
boolean |
containsKey(int key)
Checks if a given key exists in the map.
|
boolean |
containsValue(float value)
Checks if the given value exists in the map.
This method iterates over the collection, trying to find an equal object. |
boolean |
equals(Object o) |
protected int |
find(int key)
Find the actual index of a given key.
|
float |
get(int key)
Returns the value mapped with the given key.
|
protected void |
grow()
Grows the map.
|
int |
hashCode() |
boolean |
isEmpty() |
FloatIterator |
iterator()
Returns a new iterator for the mapped float values.
|
IntIterator |
keyIterator()
Returns an iterator on the map keys.
|
float |
put(int key,
float v)
Inserts the <key,value> pair into the map.
|
float |
remove(int key)
Removes a <key,value> pair from the map and returns the mapped value,
or
Float.NaN if the none existed. |
int |
size() |
float[] |
toArray()
Translates the mapped pairs' values into an array of Objects
|
float[] |
toArray(float[] a)
Translates the mapped pairs' values into an array of T
|
String |
toString() |
public static final float GROUND
public IntToFloatMap()
public IntToFloatMap(int capacity)
capacity
- minimum capacity for the map.protected int calcBaseHashIndex(int key)
hashFactor
.public void clear()
public boolean containsKey(int key)
key
- that is checked against the map data.public boolean containsValue(float value)
value
- float value that is checked against the map data.protected int find(int key)
public float get(int key)
key
- int who's mapped object we're interested in.protected void grow()
public boolean isEmpty()
public FloatIterator iterator()
public IntIterator keyIterator()
public float put(int key, float v)
Float.NaN
if the key didn't exist.public float remove(int key)
Float.NaN
if the none existed.key
- used to find the value to removeFloat.NaN
if none existed.public int size()
public float[] toArray()
public float[] toArray(float[] a)
a
- the array into which the elements of the list are to be
stored. If it is big enough use whatever space we need,
setting the one after the true data as Float.NaN
.Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.