Externalizable
, Serializable
, IntIterable
, FloatIntMap
, IntValuesMap
, MutableFloatIntMap
, MutableIntValuesMap
, PrimitiveIterable
, MutableFloatKeysMap
, FloatKeysMap
public class FloatIntHashMap extends AbstractMutableIntValuesMap implements MutableFloatIntMap, Externalizable, MutableFloatKeysMap
Constructor | Description |
---|---|
FloatIntHashMap() |
|
FloatIntHashMap(int initialCapacity) |
|
FloatIntHashMap(FloatIntMap map) |
Modifier and Type | Method | Description |
---|---|---|
int |
addToValue(float key,
int toBeAdded) |
|
MutableFloatIntMap |
asSynchronized() |
|
MutableFloatIntMap |
asUnmodifiable() |
|
void |
clear() |
|
void |
compact() |
Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
|
boolean |
containsKey(float key) |
|
boolean |
equals(Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableIntFloatMap |
flipUniqueValues() |
Return the IntFloatMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(FloatProcedure procedure) |
|
void |
forEachKeyValue(FloatIntProcedure procedure) |
|
int |
get(float key) |
|
int |
getIfAbsent(float key,
int ifAbsent) |
|
int |
getIfAbsentPut(float key,
int value) |
|
int |
getIfAbsentPut(float key,
IntFunction0 function) |
|
<P> int |
getIfAbsentPutWith(float key,
IntFunction<? super P> function,
P parameter) |
|
int |
getIfAbsentPutWithKey(float key,
FloatToIntFunction function) |
|
int |
getOrThrow(float key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectIntToObjectFunction<? super V,? extends V> function) |
|
MutableIntIterator |
intIterator() |
Returns a primitive iterator that can be used to iterate over the IntIterable in an
imperative style.
|
MutableFloatSet |
keySet() |
|
LazyFloatIterable |
keysView() |
|
RichIterable<FloatIntPair> |
keyValuesView() |
|
static FloatIntHashMap |
newWithKeysValues(float key1,
int value1) |
|
static FloatIntHashMap |
newWithKeysValues(float key1,
int value1,
float key2,
int value2) |
|
static FloatIntHashMap |
newWithKeysValues(float key1,
int value1,
float key2,
int value2,
float key3,
int value3) |
|
static FloatIntHashMap |
newWithKeysValues(float key1,
int value1,
float key2,
int value2,
float key3,
int value3,
float key4,
int value4) |
|
void |
put(float key,
int value) |
|
void |
putAll(FloatIntMap map) |
|
void |
readExternal(ObjectInput in) |
|
FloatIntHashMap |
reject(FloatIntPredicate predicate) |
|
void |
remove(float key) |
|
void |
removeKey(float key) |
|
int |
removeKeyIfAbsent(float key,
int value) |
|
FloatIntHashMap |
select(FloatIntPredicate predicate) |
|
ImmutableFloatIntMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
int |
updateValue(float key,
int initialValueIfAbsent,
IntToIntFunction function) |
|
void |
updateValues(FloatIntToIntFunction function) |
Updates the values in-place.
|
MutableIntCollection |
values() |
|
FloatIntHashMap |
withKeysValues(float key1,
int value1,
float key2,
int value2) |
|
FloatIntHashMap |
withKeysValues(float key1,
int value1,
float key2,
int value2,
float key3,
int value3) |
|
FloatIntHashMap |
withKeysValues(float key1,
int value1,
float key2,
int value2,
float key3,
int value3,
float key4,
int value4) |
|
FloatIntHashMap |
withKeyValue(float key1,
int value1) |
|
FloatIntHashMap |
withoutAllKeys(FloatIterable keys) |
|
FloatIntHashMap |
withoutKey(float key) |
|
void |
writeExternal(ObjectOutput out) |
asLazy, average, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList
allSatisfy, anySatisfy, appendString, chunk, collect, contains, containsAll, containsValue, count, detectIfNone, each, forEach, forEachValue, isEmpty, max, min, noneSatisfy, notEmpty, reject, select, size, sum, toArray
isEmpty, notEmpty, size
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedList
containsValue, forEachValue, tap
putPair, withAllKeyValues
collect, reject, select
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
public FloatIntHashMap()
public FloatIntHashMap(int initialCapacity)
public FloatIntHashMap(FloatIntMap map)
public static FloatIntHashMap newWithKeysValues(float key1, int value1)
public static FloatIntHashMap newWithKeysValues(float key1, int value1, float key2, int value2)
public static FloatIntHashMap newWithKeysValues(float key1, int value1, float key2, int value2, float key3, int value3)
public static FloatIntHashMap newWithKeysValues(float key1, int value1, float key2, int value2, float key3, int value3, float key4, int value4)
public boolean equals(Object obj)
FloatIntMap
Map.equals(Object)
.equals
in interface FloatIntMap
equals
in class Object
public int hashCode()
FloatIntMap
Map.hashCode()
.hashCode
in interface FloatIntMap
hashCode
in class Object
public String toString()
PrimitiveIterable
Assert.assertEquals("[]", IntLists.mutable.empty().toString()); Assert.assertEquals("[1]", IntLists.mutable.with(1).toString()); Assert.assertEquals("[1, 2, 3]", IntLists.mutable.with(1, 2, 3).toString());
toString
in interface FloatIntMap
toString
in interface PrimitiveIterable
toString
in class AbstractIntIterable
AbstractCollection.toString()
public MutableIntIterator intIterator()
IntIterable
intIterator
in interface IntIterable
intIterator
in interface MutableIntValuesMap
public <V> V injectInto(V injectedValue, ObjectIntToObjectFunction<? super V,? extends V> function)
injectInto
in interface IntIterable
public void clear()
clear
in interface MutableFloatKeysMap
clear
in interface MutableIntValuesMap
public void put(float key, int value)
put
in interface MutableFloatIntMap
public void putAll(FloatIntMap map)
putAll
in interface MutableFloatIntMap
public void updateValues(FloatIntToIntFunction function)
MutableFloatIntMap
updateValues
in interface MutableFloatIntMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(float key)
removeKey
in interface MutableFloatIntMap
removeKey
in interface MutableFloatKeysMap
public void remove(float key)
remove
in interface MutableFloatIntMap
public int removeKeyIfAbsent(float key, int value)
removeKeyIfAbsent
in interface MutableFloatIntMap
public int getIfAbsentPut(float key, int value)
getIfAbsentPut
in interface MutableFloatIntMap
public int getIfAbsentPut(float key, IntFunction0 function)
getIfAbsentPut
in interface MutableFloatIntMap
public <P> int getIfAbsentPutWith(float key, IntFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableFloatIntMap
public int getIfAbsentPutWithKey(float key, FloatToIntFunction function)
getIfAbsentPutWithKey
in interface MutableFloatIntMap
public int addToValue(float key, int toBeAdded)
addToValue
in interface MutableFloatIntMap
public int updateValue(float key, int initialValueIfAbsent, IntToIntFunction function)
updateValue
in interface MutableFloatIntMap
public FloatIntHashMap withKeyValue(float key1, int value1)
withKeyValue
in interface MutableFloatIntMap
public FloatIntHashMap withKeysValues(float key1, int value1, float key2, int value2)
public FloatIntHashMap withKeysValues(float key1, int value1, float key2, int value2, float key3, int value3)
public FloatIntHashMap withKeysValues(float key1, int value1, float key2, int value2, float key3, int value3, float key4, int value4)
public FloatIntHashMap withoutKey(float key)
withoutKey
in interface MutableFloatIntMap
public FloatIntHashMap withoutAllKeys(FloatIterable keys)
withoutAllKeys
in interface MutableFloatIntMap
public MutableFloatIntMap asUnmodifiable()
asUnmodifiable
in interface MutableFloatIntMap
public MutableFloatIntMap asSynchronized()
asSynchronized
in interface MutableFloatIntMap
public ImmutableFloatIntMap toImmutable()
toImmutable
in interface FloatIntMap
public int get(float key)
get
in interface FloatIntMap
public int getIfAbsent(float key, int ifAbsent)
getIfAbsent
in interface FloatIntMap
public int getOrThrow(float key)
getOrThrow
in interface FloatIntMap
public boolean containsKey(float key)
containsKey
in interface FloatIntMap
containsKey
in interface FloatKeysMap
public void forEachKey(FloatProcedure procedure)
forEachKey
in interface FloatIntMap
forEachKey
in interface FloatKeysMap
public void forEachKeyValue(FloatIntProcedure procedure)
forEachKeyValue
in interface FloatIntMap
public LazyFloatIterable keysView()
keysView
in interface FloatIntMap
public RichIterable<FloatIntPair> keyValuesView()
keyValuesView
in interface FloatIntMap
public MutableIntFloatMap flipUniqueValues()
FloatIntMap
flipUniqueValues
in interface FloatIntMap
flipUniqueValues
in interface MutableFloatIntMap
public FloatIntHashMap select(FloatIntPredicate predicate)
select
in interface FloatIntMap
select
in interface MutableFloatIntMap
public FloatIntHashMap reject(FloatIntPredicate predicate)
reject
in interface FloatIntMap
reject
in interface MutableFloatIntMap
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void compact()
public MutableFloatSet keySet()
keySet
in interface FloatIntMap
public MutableIntCollection values()
values
in interface IntValuesMap
Copyright © 2004–2019. All rights reserved.