Externalizable
, Serializable
, DoubleIterable
, ByteDoubleMap
, DoubleValuesMap
, MutableByteDoubleMap
, MutableDoubleValuesMap
, PrimitiveIterable
, MutableByteKeysMap
, ByteKeysMap
public class ByteDoubleHashMap extends AbstractMutableDoubleValuesMap implements MutableByteDoubleMap, Externalizable, MutableByteKeysMap
Constructor | Description |
---|---|
ByteDoubleHashMap() |
|
ByteDoubleHashMap(int initialCapacity) |
|
ByteDoubleHashMap(ByteDoubleMap map) |
Modifier and Type | Method | Description |
---|---|---|
double |
addToValue(byte key,
double toBeAdded) |
|
MutableByteDoubleMap |
asSynchronized() |
|
MutableByteDoubleMap |
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(byte 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) . |
MutableDoubleByteMap |
flipUniqueValues() |
Return the DoubleByteMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(ByteProcedure procedure) |
|
void |
forEachKeyValue(ByteDoubleProcedure procedure) |
|
double |
get(byte key) |
|
double |
getIfAbsent(byte key,
double ifAbsent) |
|
double |
getIfAbsentPut(byte key,
double value) |
|
double |
getIfAbsentPut(byte key,
DoubleFunction0 function) |
|
<P> double |
getIfAbsentPutWith(byte key,
DoubleFunction<? super P> function,
P parameter) |
|
double |
getIfAbsentPutWithKey(byte key,
ByteToDoubleFunction function) |
|
double |
getOrThrow(byte key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectDoubleToObjectFunction<? super V,? extends V> function) |
|
MutableByteSet |
keySet() |
|
LazyByteIterable |
keysView() |
|
RichIterable<ByteDoublePair> |
keyValuesView() |
|
static ByteDoubleHashMap |
newWithKeysValues(byte key1,
double value1) |
|
static ByteDoubleHashMap |
newWithKeysValues(byte key1,
double value1,
byte key2,
double value2) |
|
static ByteDoubleHashMap |
newWithKeysValues(byte key1,
double value1,
byte key2,
double value2,
byte key3,
double value3) |
|
static ByteDoubleHashMap |
newWithKeysValues(byte key1,
double value1,
byte key2,
double value2,
byte key3,
double value3,
byte key4,
double value4) |
|
void |
put(byte key,
double value) |
|
void |
putAll(ByteDoubleMap map) |
|
void |
readExternal(ObjectInput in) |
|
ByteDoubleHashMap |
reject(ByteDoublePredicate predicate) |
|
void |
remove(byte key) |
|
void |
removeKey(byte key) |
|
double |
removeKeyIfAbsent(byte key,
double value) |
|
ByteDoubleHashMap |
select(ByteDoublePredicate predicate) |
|
ImmutableByteDoubleMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
double |
updateValue(byte key,
double initialValueIfAbsent,
DoubleToDoubleFunction function) |
|
void |
updateValues(ByteDoubleToDoubleFunction function) |
Updates the values in-place.
|
MutableDoubleCollection |
values() |
|
ByteDoubleHashMap |
withKeysValues(byte key1,
double value1,
byte key2,
double value2) |
|
ByteDoubleHashMap |
withKeysValues(byte key1,
double value1,
byte key2,
double value2,
byte key3,
double value3) |
|
ByteDoubleHashMap |
withKeysValues(byte key1,
double value1,
byte key2,
double value2,
byte key3,
double value3,
byte key4,
double value4) |
|
ByteDoubleHashMap |
withKeyValue(byte key1,
double value1) |
|
ByteDoubleHashMap |
withoutAllKeys(ByteIterable keys) |
|
ByteDoubleHashMap |
withoutKey(byte 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 ByteDoubleHashMap()
public ByteDoubleHashMap(int initialCapacity)
public ByteDoubleHashMap(ByteDoubleMap map)
public static ByteDoubleHashMap newWithKeysValues(byte key1, double value1)
public static ByteDoubleHashMap newWithKeysValues(byte key1, double value1, byte key2, double value2)
public static ByteDoubleHashMap newWithKeysValues(byte key1, double value1, byte key2, double value2, byte key3, double value3)
public static ByteDoubleHashMap newWithKeysValues(byte key1, double value1, byte key2, double value2, byte key3, double value3, byte key4, double value4)
public boolean equals(Object obj)
ByteDoubleMap
Map.equals(Object)
.equals
in interface ByteDoubleMap
equals
in class Object
public int hashCode()
ByteDoubleMap
Map.hashCode()
.hashCode
in interface ByteDoubleMap
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 ByteDoubleMap
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 MutableByteKeysMap
clear
in interface MutableDoubleValuesMap
public void put(byte key, double value)
put
in interface MutableByteDoubleMap
public void putAll(ByteDoubleMap map)
putAll
in interface MutableByteDoubleMap
public void updateValues(ByteDoubleToDoubleFunction function)
MutableByteDoubleMap
updateValues
in interface MutableByteDoubleMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(byte key)
removeKey
in interface MutableByteDoubleMap
removeKey
in interface MutableByteKeysMap
public void remove(byte key)
remove
in interface MutableByteDoubleMap
public double removeKeyIfAbsent(byte key, double value)
removeKeyIfAbsent
in interface MutableByteDoubleMap
public double getIfAbsentPut(byte key, double value)
getIfAbsentPut
in interface MutableByteDoubleMap
public double getIfAbsentPut(byte key, DoubleFunction0 function)
getIfAbsentPut
in interface MutableByteDoubleMap
public <P> double getIfAbsentPutWith(byte key, DoubleFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableByteDoubleMap
public double getIfAbsentPutWithKey(byte key, ByteToDoubleFunction function)
getIfAbsentPutWithKey
in interface MutableByteDoubleMap
public double addToValue(byte key, double toBeAdded)
addToValue
in interface MutableByteDoubleMap
public double updateValue(byte key, double initialValueIfAbsent, DoubleToDoubleFunction function)
updateValue
in interface MutableByteDoubleMap
public ByteDoubleHashMap withKeyValue(byte key1, double value1)
withKeyValue
in interface MutableByteDoubleMap
public ByteDoubleHashMap withKeysValues(byte key1, double value1, byte key2, double value2)
public ByteDoubleHashMap withKeysValues(byte key1, double value1, byte key2, double value2, byte key3, double value3)
public ByteDoubleHashMap withKeysValues(byte key1, double value1, byte key2, double value2, byte key3, double value3, byte key4, double value4)
public ByteDoubleHashMap withoutKey(byte key)
withoutKey
in interface MutableByteDoubleMap
public ByteDoubleHashMap withoutAllKeys(ByteIterable keys)
withoutAllKeys
in interface MutableByteDoubleMap
public MutableByteDoubleMap asUnmodifiable()
asUnmodifiable
in interface MutableByteDoubleMap
public MutableByteDoubleMap asSynchronized()
asSynchronized
in interface MutableByteDoubleMap
public ImmutableByteDoubleMap toImmutable()
toImmutable
in interface ByteDoubleMap
public double get(byte key)
get
in interface ByteDoubleMap
public double getIfAbsent(byte key, double ifAbsent)
getIfAbsent
in interface ByteDoubleMap
public double getOrThrow(byte key)
getOrThrow
in interface ByteDoubleMap
public boolean containsKey(byte key)
containsKey
in interface ByteDoubleMap
containsKey
in interface ByteKeysMap
public void forEachKey(ByteProcedure procedure)
forEachKey
in interface ByteDoubleMap
forEachKey
in interface ByteKeysMap
public void forEachKeyValue(ByteDoubleProcedure procedure)
forEachKeyValue
in interface ByteDoubleMap
public LazyByteIterable keysView()
keysView
in interface ByteDoubleMap
public RichIterable<ByteDoublePair> keyValuesView()
keyValuesView
in interface ByteDoubleMap
public MutableDoubleByteMap flipUniqueValues()
ByteDoubleMap
flipUniqueValues
in interface ByteDoubleMap
flipUniqueValues
in interface MutableByteDoubleMap
public ByteDoubleHashMap select(ByteDoublePredicate predicate)
select
in interface ByteDoubleMap
select
in interface MutableByteDoubleMap
public ByteDoubleHashMap reject(ByteDoublePredicate predicate)
reject
in interface ByteDoubleMap
reject
in interface MutableByteDoubleMap
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 MutableByteSet keySet()
keySet
in interface ByteDoubleMap
public MutableDoubleCollection values()
values
in interface DoubleValuesMap
Copyright © 2004–2019. All rights reserved.