java.io.Externalizable
, java.io.Serializable
, DoubleIterable
, DoubleValuesMap
, IntDoubleMap
, MutableDoubleValuesMap
, MutableIntDoubleMap
, PrimitiveIterable
, MutableIntKeysMap
, IntKeysMap
public class IntDoubleHashMap extends AbstractMutableDoubleValuesMap implements MutableIntDoubleMap, java.io.Externalizable, MutableIntKeysMap
Constructor | Description |
---|---|
IntDoubleHashMap() |
|
IntDoubleHashMap(int initialCapacity) |
|
IntDoubleHashMap(IntDoubleMap map) |
Modifier and Type | Method | Description |
---|---|---|
double |
addToValue(int key,
double toBeAdded) |
|
MutableIntDoubleMap |
asSynchronized() |
|
MutableIntDoubleMap |
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(int key) |
|
MutableDoubleIterator |
doubleIterator() |
Returns a primitive iterator that can be used to iterate over the DoubleIterable in an
imperative style.
|
boolean |
equals(java.lang.Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableDoubleIntMap |
flipUniqueValues() |
Return the DoubleIntMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(IntProcedure procedure) |
|
void |
forEachKeyValue(IntDoubleProcedure procedure) |
|
double |
get(int key) |
|
double |
getIfAbsent(int key,
double ifAbsent) |
|
double |
getIfAbsentPut(int key,
double value) |
|
double |
getIfAbsentPut(int key,
DoubleFunction0 function) |
|
<P> double |
getIfAbsentPutWith(int key,
DoubleFunction<? super P> function,
P parameter) |
|
double |
getIfAbsentPutWithKey(int key,
IntToDoubleFunction function) |
|
double |
getOrThrow(int key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectDoubleToObjectFunction<? super V,? extends V> function) |
|
MutableIntSet |
keySet() |
|
LazyIntIterable |
keysView() |
|
RichIterable<IntDoublePair> |
keyValuesView() |
|
static IntDoubleHashMap |
newWithKeysValues(int key1,
double value1) |
|
static IntDoubleHashMap |
newWithKeysValues(int key1,
double value1,
int key2,
double value2) |
|
static IntDoubleHashMap |
newWithKeysValues(int key1,
double value1,
int key2,
double value2,
int key3,
double value3) |
|
static IntDoubleHashMap |
newWithKeysValues(int key1,
double value1,
int key2,
double value2,
int key3,
double value3,
int key4,
double value4) |
|
void |
put(int key,
double value) |
|
void |
putAll(IntDoubleMap map) |
|
void |
readExternal(java.io.ObjectInput in) |
|
IntDoubleHashMap |
reject(IntDoublePredicate predicate) |
|
void |
remove(int key) |
|
void |
removeKey(int key) |
|
double |
removeKeyIfAbsent(int key,
double value) |
|
IntDoubleHashMap |
select(IntDoublePredicate predicate) |
|
ImmutableIntDoubleMap |
toImmutable() |
|
java.lang.String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
double |
updateValue(int key,
double initialValueIfAbsent,
DoubleToDoubleFunction function) |
|
void |
updateValues(IntDoubleToDoubleFunction function) |
Updates the values in-place.
|
MutableDoubleCollection |
values() |
|
IntDoubleHashMap |
withKeysValues(int key1,
double value1,
int key2,
double value2) |
|
IntDoubleHashMap |
withKeysValues(int key1,
double value1,
int key2,
double value2,
int key3,
double value3) |
|
IntDoubleHashMap |
withKeysValues(int key1,
double value1,
int key2,
double value2,
int key3,
double value3,
int key4,
double value4) |
|
IntDoubleHashMap |
withKeyValue(int key1,
double value1) |
|
IntDoubleHashMap |
withoutAllKeys(IntIterable keys) |
|
IntDoubleHashMap |
withoutKey(int key) |
|
void |
writeExternal(java.io.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
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
isEmpty, notEmpty, size
collect, reject, select
putPair, withAllKeyValues
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
public IntDoubleHashMap()
public IntDoubleHashMap(int initialCapacity)
public IntDoubleHashMap(IntDoubleMap map)
public static IntDoubleHashMap newWithKeysValues(int key1, double value1)
public static IntDoubleHashMap newWithKeysValues(int key1, double value1, int key2, double value2)
public static IntDoubleHashMap newWithKeysValues(int key1, double value1, int key2, double value2, int key3, double value3)
public static IntDoubleHashMap newWithKeysValues(int key1, double value1, int key2, double value2, int key3, double value3, int key4, double value4)
public boolean equals(java.lang.Object obj)
IntDoubleMap
Map.equals(Object)
.equals
in interface IntDoubleMap
equals
in class java.lang.Object
public int hashCode()
IntDoubleMap
Map.hashCode()
.hashCode
in interface IntDoubleMap
hashCode
in class java.lang.Object
public java.lang.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 IntDoubleMap
toString
in interface PrimitiveIterable
toString
in class AbstractDoubleIterable
AbstractCollection.toString()
public MutableDoubleIterator doubleIterator()
DoubleIterable
doubleIterator
in interface DoubleIterable
doubleIterator
in interface MutableDoubleValuesMap
public <V> V injectInto(V injectedValue, ObjectDoubleToObjectFunction<? super V,? extends V> function)
injectInto
in interface DoubleIterable
public void clear()
clear
in interface MutableDoubleValuesMap
clear
in interface MutableIntKeysMap
public void put(int key, double value)
put
in interface MutableIntDoubleMap
public void putAll(IntDoubleMap map)
putAll
in interface MutableIntDoubleMap
public void updateValues(IntDoubleToDoubleFunction function)
MutableIntDoubleMap
updateValues
in interface MutableIntDoubleMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(int key)
removeKey
in interface MutableIntDoubleMap
removeKey
in interface MutableIntKeysMap
public void remove(int key)
remove
in interface MutableIntDoubleMap
public double removeKeyIfAbsent(int key, double value)
removeKeyIfAbsent
in interface MutableIntDoubleMap
public double getIfAbsentPut(int key, double value)
getIfAbsentPut
in interface MutableIntDoubleMap
public double getIfAbsentPut(int key, DoubleFunction0 function)
getIfAbsentPut
in interface MutableIntDoubleMap
public <P> double getIfAbsentPutWith(int key, DoubleFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableIntDoubleMap
public double getIfAbsentPutWithKey(int key, IntToDoubleFunction function)
getIfAbsentPutWithKey
in interface MutableIntDoubleMap
public double addToValue(int key, double toBeAdded)
addToValue
in interface MutableIntDoubleMap
public double updateValue(int key, double initialValueIfAbsent, DoubleToDoubleFunction function)
updateValue
in interface MutableIntDoubleMap
public IntDoubleHashMap withKeyValue(int key1, double value1)
withKeyValue
in interface MutableIntDoubleMap
public IntDoubleHashMap withKeysValues(int key1, double value1, int key2, double value2)
public IntDoubleHashMap withKeysValues(int key1, double value1, int key2, double value2, int key3, double value3)
public IntDoubleHashMap withKeysValues(int key1, double value1, int key2, double value2, int key3, double value3, int key4, double value4)
public IntDoubleHashMap withoutKey(int key)
withoutKey
in interface MutableIntDoubleMap
public IntDoubleHashMap withoutAllKeys(IntIterable keys)
withoutAllKeys
in interface MutableIntDoubleMap
public MutableIntDoubleMap asUnmodifiable()
asUnmodifiable
in interface MutableIntDoubleMap
public MutableIntDoubleMap asSynchronized()
asSynchronized
in interface MutableIntDoubleMap
public ImmutableIntDoubleMap toImmutable()
toImmutable
in interface IntDoubleMap
public double get(int key)
get
in interface IntDoubleMap
public double getIfAbsent(int key, double ifAbsent)
getIfAbsent
in interface IntDoubleMap
public double getOrThrow(int key)
getOrThrow
in interface IntDoubleMap
public boolean containsKey(int key)
containsKey
in interface IntDoubleMap
containsKey
in interface IntKeysMap
public void forEachKey(IntProcedure procedure)
forEachKey
in interface IntDoubleMap
forEachKey
in interface IntKeysMap
public void forEachKeyValue(IntDoubleProcedure procedure)
forEachKeyValue
in interface IntDoubleMap
public LazyIntIterable keysView()
keysView
in interface IntDoubleMap
public RichIterable<IntDoublePair> keyValuesView()
keyValuesView
in interface IntDoubleMap
public MutableDoubleIntMap flipUniqueValues()
IntDoubleMap
flipUniqueValues
in interface IntDoubleMap
flipUniqueValues
in interface MutableIntDoubleMap
public IntDoubleHashMap select(IntDoublePredicate predicate)
select
in interface IntDoubleMap
select
in interface MutableIntDoubleMap
public IntDoubleHashMap reject(IntDoublePredicate predicate)
reject
in interface IntDoubleMap
reject
in interface MutableIntDoubleMap
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void compact()
public MutableIntSet keySet()
keySet
in interface IntDoubleMap
public MutableDoubleCollection values()
values
in interface DoubleValuesMap
Copyright © 2004–2020. All rights reserved.