Externalizable
, Serializable
, DoubleIterable
, CharDoubleMap
, DoubleValuesMap
, MutableCharDoubleMap
, MutableDoubleValuesMap
, PrimitiveIterable
, MutableCharKeysMap
, CharKeysMap
public class CharDoubleHashMap extends AbstractMutableDoubleValuesMap implements MutableCharDoubleMap, Externalizable, MutableCharKeysMap
Constructor | Description |
---|---|
CharDoubleHashMap() |
|
CharDoubleHashMap(int initialCapacity) |
|
CharDoubleHashMap(CharDoubleMap map) |
Modifier and Type | Method | Description |
---|---|---|
double |
addToValue(char key,
double toBeAdded) |
|
MutableCharDoubleMap |
asSynchronized() |
|
MutableCharDoubleMap |
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(char key) |
|
MutableDoubleIterator |
doubleIterator() |
Returns a primitive iterator that can be used to iterate over the DoubleIterable in an
imperative style.
|
boolean |
equals(Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableDoubleCharMap |
flipUniqueValues() |
Return the DoubleCharMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(CharProcedure procedure) |
|
void |
forEachKeyValue(CharDoubleProcedure procedure) |
|
double |
get(char key) |
|
double |
getIfAbsent(char key,
double ifAbsent) |
|
double |
getIfAbsentPut(char key,
double value) |
|
double |
getIfAbsentPut(char key,
DoubleFunction0 function) |
|
<P> double |
getIfAbsentPutWith(char key,
DoubleFunction<? super P> function,
P parameter) |
|
double |
getIfAbsentPutWithKey(char key,
CharToDoubleFunction function) |
|
double |
getOrThrow(char key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectDoubleToObjectFunction<? super V,? extends V> function) |
|
MutableCharSet |
keySet() |
|
LazyCharIterable |
keysView() |
|
RichIterable<CharDoublePair> |
keyValuesView() |
|
static CharDoubleHashMap |
newWithKeysValues(char key1,
double value1) |
|
static CharDoubleHashMap |
newWithKeysValues(char key1,
double value1,
char key2,
double value2) |
|
static CharDoubleHashMap |
newWithKeysValues(char key1,
double value1,
char key2,
double value2,
char key3,
double value3) |
|
static CharDoubleHashMap |
newWithKeysValues(char key1,
double value1,
char key2,
double value2,
char key3,
double value3,
char key4,
double value4) |
|
void |
put(char key,
double value) |
|
void |
putAll(CharDoubleMap map) |
|
void |
readExternal(ObjectInput in) |
|
CharDoubleHashMap |
reject(CharDoublePredicate predicate) |
|
void |
remove(char key) |
|
void |
removeKey(char key) |
|
double |
removeKeyIfAbsent(char key,
double value) |
|
CharDoubleHashMap |
select(CharDoublePredicate predicate) |
|
ImmutableCharDoubleMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
double |
updateValue(char key,
double initialValueIfAbsent,
DoubleToDoubleFunction function) |
|
void |
updateValues(CharDoubleToDoubleFunction function) |
Updates the values in-place.
|
MutableDoubleCollection |
values() |
|
CharDoubleHashMap |
withKeysValues(char key1,
double value1,
char key2,
double value2) |
|
CharDoubleHashMap |
withKeysValues(char key1,
double value1,
char key2,
double value2,
char key3,
double value3) |
|
CharDoubleHashMap |
withKeysValues(char key1,
double value1,
char key2,
double value2,
char key3,
double value3,
char key4,
double value4) |
|
CharDoubleHashMap |
withKeyValue(char key1,
double value1) |
|
CharDoubleHashMap |
withoutAllKeys(CharIterable keys) |
|
CharDoubleHashMap |
withoutKey(char 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 CharDoubleHashMap()
public CharDoubleHashMap(int initialCapacity)
public CharDoubleHashMap(CharDoubleMap map)
public static CharDoubleHashMap newWithKeysValues(char key1, double value1)
public static CharDoubleHashMap newWithKeysValues(char key1, double value1, char key2, double value2)
public static CharDoubleHashMap newWithKeysValues(char key1, double value1, char key2, double value2, char key3, double value3)
public static CharDoubleHashMap newWithKeysValues(char key1, double value1, char key2, double value2, char key3, double value3, char key4, double value4)
public boolean equals(Object obj)
CharDoubleMap
Map.equals(Object)
.equals
in interface CharDoubleMap
equals
in class Object
public int hashCode()
CharDoubleMap
Map.hashCode()
.hashCode
in interface CharDoubleMap
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 CharDoubleMap
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 MutableCharKeysMap
clear
in interface MutableDoubleValuesMap
public void put(char key, double value)
put
in interface MutableCharDoubleMap
public void putAll(CharDoubleMap map)
putAll
in interface MutableCharDoubleMap
public void updateValues(CharDoubleToDoubleFunction function)
MutableCharDoubleMap
updateValues
in interface MutableCharDoubleMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(char key)
removeKey
in interface MutableCharDoubleMap
removeKey
in interface MutableCharKeysMap
public void remove(char key)
remove
in interface MutableCharDoubleMap
public double removeKeyIfAbsent(char key, double value)
removeKeyIfAbsent
in interface MutableCharDoubleMap
public double getIfAbsentPut(char key, double value)
getIfAbsentPut
in interface MutableCharDoubleMap
public double getIfAbsentPut(char key, DoubleFunction0 function)
getIfAbsentPut
in interface MutableCharDoubleMap
public <P> double getIfAbsentPutWith(char key, DoubleFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableCharDoubleMap
public double getIfAbsentPutWithKey(char key, CharToDoubleFunction function)
getIfAbsentPutWithKey
in interface MutableCharDoubleMap
public double addToValue(char key, double toBeAdded)
addToValue
in interface MutableCharDoubleMap
public double updateValue(char key, double initialValueIfAbsent, DoubleToDoubleFunction function)
updateValue
in interface MutableCharDoubleMap
public CharDoubleHashMap withKeyValue(char key1, double value1)
withKeyValue
in interface MutableCharDoubleMap
public CharDoubleHashMap withKeysValues(char key1, double value1, char key2, double value2)
public CharDoubleHashMap withKeysValues(char key1, double value1, char key2, double value2, char key3, double value3)
public CharDoubleHashMap withKeysValues(char key1, double value1, char key2, double value2, char key3, double value3, char key4, double value4)
public CharDoubleHashMap withoutKey(char key)
withoutKey
in interface MutableCharDoubleMap
public CharDoubleHashMap withoutAllKeys(CharIterable keys)
withoutAllKeys
in interface MutableCharDoubleMap
public MutableCharDoubleMap asUnmodifiable()
asUnmodifiable
in interface MutableCharDoubleMap
public MutableCharDoubleMap asSynchronized()
asSynchronized
in interface MutableCharDoubleMap
public ImmutableCharDoubleMap toImmutable()
toImmutable
in interface CharDoubleMap
public double get(char key)
get
in interface CharDoubleMap
public double getIfAbsent(char key, double ifAbsent)
getIfAbsent
in interface CharDoubleMap
public double getOrThrow(char key)
getOrThrow
in interface CharDoubleMap
public boolean containsKey(char key)
containsKey
in interface CharDoubleMap
containsKey
in interface CharKeysMap
public void forEachKey(CharProcedure procedure)
forEachKey
in interface CharDoubleMap
forEachKey
in interface CharKeysMap
public void forEachKeyValue(CharDoubleProcedure procedure)
forEachKeyValue
in interface CharDoubleMap
public LazyCharIterable keysView()
keysView
in interface CharDoubleMap
public RichIterable<CharDoublePair> keyValuesView()
keyValuesView
in interface CharDoubleMap
public MutableDoubleCharMap flipUniqueValues()
CharDoubleMap
flipUniqueValues
in interface CharDoubleMap
flipUniqueValues
in interface MutableCharDoubleMap
public CharDoubleHashMap select(CharDoublePredicate predicate)
select
in interface CharDoubleMap
select
in interface MutableCharDoubleMap
public CharDoubleHashMap reject(CharDoublePredicate predicate)
reject
in interface CharDoubleMap
reject
in interface MutableCharDoubleMap
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 MutableCharSet keySet()
keySet
in interface CharDoubleMap
public MutableDoubleCollection values()
values
in interface DoubleValuesMap
Copyright © 2004–2019. All rights reserved.