public class ObjectFloatMap<K> extends Object implements Iterable<ObjectFloatMap.Entry<K>>
Modifier and Type | Class and Description |
---|---|
static class |
ObjectFloatMap.Entries<K> |
static class |
ObjectFloatMap.Entry<K> |
static class |
ObjectFloatMap.Keys<K> |
static class |
ObjectFloatMap.Values |
Modifier and Type | Field and Description |
---|---|
int |
size |
Constructor and Description |
---|
ObjectFloatMap()
Creates a new map with an initial capacity of 51 and a load factor of 0.8.
|
ObjectFloatMap(int initialCapacity)
Creates a new map with a load factor of 0.8.
|
ObjectFloatMap(int initialCapacity,
float loadFactor)
Creates a new map with the specified initial capacity and load factor.
|
ObjectFloatMap(ObjectFloatMap<? extends K> map)
Creates a new map identical to the specified map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
clear(int maximumCapacity)
Clears the map and reduces the size of the backing arrays to be the specified capacity if they are larger.
|
boolean |
containsKey(K key) |
boolean |
containsValue(float value)
Returns true if the specified value is in the map.
|
void |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to accommodate the specified number of additional items.
|
ObjectFloatMap.Entries<K> |
entries()
Returns an iterator for the entries in the map.
|
boolean |
equals(Object obj) |
K |
findKey(float value)
Returns the key for the specified value, or null if it is not in the map.
|
float |
get(K key,
float defaultValue) |
float |
getAndIncrement(K key,
float defaultValue,
float increment)
Returns the key's current value and increments the stored value.
|
int |
hashCode() |
boolean |
isEmpty()
Returns true if the map is empty.
|
ObjectFloatMap.Entries<K> |
iterator() |
ObjectFloatMap.Keys<K> |
keys()
Returns an iterator for the keys in the map.
|
boolean |
notEmpty()
Returns true if the map has one or more items.
|
void |
put(K key,
float value) |
void |
putAll(ObjectFloatMap<? extends K> map) |
float |
remove(K key,
float defaultValue) |
void |
shrink(int maximumCapacity)
Reduces the size of the backing arrays to be the specified capacity or less.
|
String |
toString() |
ObjectFloatMap.Values |
values()
Returns an iterator for the values in the map.
|
forEach, spliterator
public ObjectFloatMap()
public ObjectFloatMap(int initialCapacity)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.public ObjectFloatMap(int initialCapacity, float loadFactor)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.public ObjectFloatMap(ObjectFloatMap<? extends K> map)
public void put(K key, float value)
public void putAll(ObjectFloatMap<? extends K> map)
public float get(K key, float defaultValue)
defaultValue
- Returned if the key was not associated with a value.public float getAndIncrement(K key, float defaultValue, float increment)
public float remove(K key, float defaultValue)
public boolean notEmpty()
public boolean isEmpty()
public void shrink(int maximumCapacity)
public void clear(int maximumCapacity)
public void clear()
public boolean containsValue(float value)
public boolean containsKey(K key)
public K findKey(float value)
public void ensureCapacity(int additionalCapacity)
public ObjectFloatMap.Entries<K> iterator()
iterator
in interface Iterable<ObjectFloatMap.Entry<K>>
public ObjectFloatMap.Entries<K> entries()
If Collections.allocateIterators
is false, the same iterator instance is returned each time this method is called. Use the
ObjectFloatMap.Entries
constructor for nested or multithreaded iteration.
public ObjectFloatMap.Values values()
If Collections.allocateIterators
is false, the same iterator instance is returned each time this method is called. Use the
ObjectFloatMap.Entries
constructor for nested or multithreaded iteration.
public ObjectFloatMap.Keys<K> keys()
If Collections.allocateIterators
is false, the same iterator instance is returned each time this method is called. Use the
ObjectFloatMap.Entries
constructor for nested or multithreaded iteration.
Copyright © 2019. All rights reserved.