Externalizable
, Serializable
, IntIterable
, DoubleIntMap
, IntValuesMap
, MutableDoubleIntMap
, MutableIntValuesMap
, PrimitiveIterable
, MutableDoubleKeysMap
, DoubleKeysMap
public class DoubleIntHashMap extends AbstractMutableIntValuesMap implements MutableDoubleIntMap, Externalizable, MutableDoubleKeysMap
Constructor | Description |
---|---|
DoubleIntHashMap() |
|
DoubleIntHashMap(int initialCapacity) |
|
DoubleIntHashMap(DoubleIntMap map) |
Modifier and Type | Method | Description |
---|---|---|
int |
addToValue(double key,
int toBeAdded) |
|
MutableDoubleIntMap |
asSynchronized() |
|
MutableDoubleIntMap |
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(double key) |
|
boolean |
equals(Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableIntDoubleMap |
flipUniqueValues() |
Return the IntDoubleMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(DoubleProcedure procedure) |
|
void |
forEachKeyValue(DoubleIntProcedure procedure) |
|
int |
get(double key) |
|
int |
getIfAbsent(double key,
int ifAbsent) |
|
int |
getIfAbsentPut(double key,
int value) |
|
int |
getIfAbsentPut(double key,
IntFunction0 function) |
|
<P> int |
getIfAbsentPutWith(double key,
IntFunction<? super P> function,
P parameter) |
|
int |
getIfAbsentPutWithKey(double key,
DoubleToIntFunction function) |
|
int |
getOrThrow(double 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.
|
MutableDoubleSet |
keySet() |
|
LazyDoubleIterable |
keysView() |
|
RichIterable<DoubleIntPair> |
keyValuesView() |
|
static DoubleIntHashMap |
newWithKeysValues(double key1,
int value1) |
|
static DoubleIntHashMap |
newWithKeysValues(double key1,
int value1,
double key2,
int value2) |
|
static DoubleIntHashMap |
newWithKeysValues(double key1,
int value1,
double key2,
int value2,
double key3,
int value3) |
|
static DoubleIntHashMap |
newWithKeysValues(double key1,
int value1,
double key2,
int value2,
double key3,
int value3,
double key4,
int value4) |
|
void |
put(double key,
int value) |
|
void |
putAll(DoubleIntMap map) |
|
void |
readExternal(ObjectInput in) |
|
DoubleIntHashMap |
reject(DoubleIntPredicate predicate) |
|
void |
remove(double key) |
|
void |
removeKey(double key) |
|
int |
removeKeyIfAbsent(double key,
int value) |
|
DoubleIntHashMap |
select(DoubleIntPredicate predicate) |
|
ImmutableDoubleIntMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
int |
updateValue(double key,
int initialValueIfAbsent,
IntToIntFunction function) |
|
void |
updateValues(DoubleIntToIntFunction function) |
Updates the values in-place.
|
MutableIntCollection |
values() |
|
DoubleIntHashMap |
withKeysValues(double key1,
int value1,
double key2,
int value2) |
|
DoubleIntHashMap |
withKeysValues(double key1,
int value1,
double key2,
int value2,
double key3,
int value3) |
|
DoubleIntHashMap |
withKeysValues(double key1,
int value1,
double key2,
int value2,
double key3,
int value3,
double key4,
int value4) |
|
DoubleIntHashMap |
withKeyValue(double key1,
int value1) |
|
DoubleIntHashMap |
withoutAllKeys(DoubleIterable keys) |
|
DoubleIntHashMap |
withoutKey(double 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 DoubleIntHashMap()
public DoubleIntHashMap(int initialCapacity)
public DoubleIntHashMap(DoubleIntMap map)
public static DoubleIntHashMap newWithKeysValues(double key1, int value1)
public static DoubleIntHashMap newWithKeysValues(double key1, int value1, double key2, int value2)
public static DoubleIntHashMap newWithKeysValues(double key1, int value1, double key2, int value2, double key3, int value3)
public static DoubleIntHashMap newWithKeysValues(double key1, int value1, double key2, int value2, double key3, int value3, double key4, int value4)
public boolean equals(Object obj)
DoubleIntMap
Map.equals(Object)
.equals
in interface DoubleIntMap
equals
in class Object
public int hashCode()
DoubleIntMap
Map.hashCode()
.hashCode
in interface DoubleIntMap
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 DoubleIntMap
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 MutableDoubleKeysMap
clear
in interface MutableIntValuesMap
public void put(double key, int value)
put
in interface MutableDoubleIntMap
public void putAll(DoubleIntMap map)
putAll
in interface MutableDoubleIntMap
public void updateValues(DoubleIntToIntFunction function)
MutableDoubleIntMap
updateValues
in interface MutableDoubleIntMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(double key)
removeKey
in interface MutableDoubleIntMap
removeKey
in interface MutableDoubleKeysMap
public void remove(double key)
remove
in interface MutableDoubleIntMap
public int removeKeyIfAbsent(double key, int value)
removeKeyIfAbsent
in interface MutableDoubleIntMap
public int getIfAbsentPut(double key, int value)
getIfAbsentPut
in interface MutableDoubleIntMap
public int getIfAbsentPut(double key, IntFunction0 function)
getIfAbsentPut
in interface MutableDoubleIntMap
public <P> int getIfAbsentPutWith(double key, IntFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableDoubleIntMap
public int getIfAbsentPutWithKey(double key, DoubleToIntFunction function)
getIfAbsentPutWithKey
in interface MutableDoubleIntMap
public int addToValue(double key, int toBeAdded)
addToValue
in interface MutableDoubleIntMap
public int updateValue(double key, int initialValueIfAbsent, IntToIntFunction function)
updateValue
in interface MutableDoubleIntMap
public DoubleIntHashMap withKeyValue(double key1, int value1)
withKeyValue
in interface MutableDoubleIntMap
public DoubleIntHashMap withKeysValues(double key1, int value1, double key2, int value2)
public DoubleIntHashMap withKeysValues(double key1, int value1, double key2, int value2, double key3, int value3)
public DoubleIntHashMap withKeysValues(double key1, int value1, double key2, int value2, double key3, int value3, double key4, int value4)
public DoubleIntHashMap withoutKey(double key)
withoutKey
in interface MutableDoubleIntMap
public DoubleIntHashMap withoutAllKeys(DoubleIterable keys)
withoutAllKeys
in interface MutableDoubleIntMap
public MutableDoubleIntMap asUnmodifiable()
asUnmodifiable
in interface MutableDoubleIntMap
public MutableDoubleIntMap asSynchronized()
asSynchronized
in interface MutableDoubleIntMap
public ImmutableDoubleIntMap toImmutable()
toImmutable
in interface DoubleIntMap
public int get(double key)
get
in interface DoubleIntMap
public int getIfAbsent(double key, int ifAbsent)
getIfAbsent
in interface DoubleIntMap
public int getOrThrow(double key)
getOrThrow
in interface DoubleIntMap
public boolean containsKey(double key)
containsKey
in interface DoubleIntMap
containsKey
in interface DoubleKeysMap
public void forEachKey(DoubleProcedure procedure)
forEachKey
in interface DoubleIntMap
forEachKey
in interface DoubleKeysMap
public void forEachKeyValue(DoubleIntProcedure procedure)
forEachKeyValue
in interface DoubleIntMap
public LazyDoubleIterable keysView()
keysView
in interface DoubleIntMap
public RichIterable<DoubleIntPair> keyValuesView()
keyValuesView
in interface DoubleIntMap
public MutableIntDoubleMap flipUniqueValues()
DoubleIntMap
flipUniqueValues
in interface DoubleIntMap
flipUniqueValues
in interface MutableDoubleIntMap
public DoubleIntHashMap select(DoubleIntPredicate predicate)
select
in interface DoubleIntMap
select
in interface MutableDoubleIntMap
public DoubleIntHashMap reject(DoubleIntPredicate predicate)
reject
in interface DoubleIntMap
reject
in interface MutableDoubleIntMap
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 MutableDoubleSet keySet()
keySet
in interface DoubleIntMap
public MutableIntCollection values()
values
in interface IntValuesMap
Copyright © 2004–2019. All rights reserved.