Externalizable
, Serializable
, LongIterable
, LongValuesMap
, MutableLongValuesMap
, MutableShortLongMap
, ShortLongMap
, PrimitiveIterable
, MutableShortKeysMap
, ShortKeysMap
public class ShortLongHashMap extends AbstractMutableLongValuesMap implements MutableShortLongMap, Externalizable, MutableShortKeysMap
Constructor | Description |
---|---|
ShortLongHashMap() |
|
ShortLongHashMap(int initialCapacity) |
|
ShortLongHashMap(ShortLongMap map) |
Modifier and Type | Method | Description |
---|---|---|
long |
addToValue(short key,
long toBeAdded) |
|
MutableShortLongMap |
asSynchronized() |
|
MutableShortLongMap |
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(short key) |
|
boolean |
equals(Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableLongShortMap |
flipUniqueValues() |
Return the LongShortMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(ShortProcedure procedure) |
|
void |
forEachKeyValue(ShortLongProcedure procedure) |
|
long |
get(short key) |
|
long |
getIfAbsent(short key,
long ifAbsent) |
|
long |
getIfAbsentPut(short key,
long value) |
|
long |
getIfAbsentPut(short key,
LongFunction0 function) |
|
<P> long |
getIfAbsentPutWith(short key,
LongFunction<? super P> function,
P parameter) |
|
long |
getIfAbsentPutWithKey(short key,
ShortToLongFunction function) |
|
long |
getOrThrow(short key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectLongToObjectFunction<? super V,? extends V> function) |
|
MutableShortSet |
keySet() |
|
LazyShortIterable |
keysView() |
|
RichIterable<ShortLongPair> |
keyValuesView() |
|
MutableLongIterator |
longIterator() |
Returns a primitive iterator that can be used to iterate over the LongIterable in an
imperative style.
|
static ShortLongHashMap |
newWithKeysValues(short key1,
long value1) |
|
static ShortLongHashMap |
newWithKeysValues(short key1,
long value1,
short key2,
long value2) |
|
static ShortLongHashMap |
newWithKeysValues(short key1,
long value1,
short key2,
long value2,
short key3,
long value3) |
|
static ShortLongHashMap |
newWithKeysValues(short key1,
long value1,
short key2,
long value2,
short key3,
long value3,
short key4,
long value4) |
|
void |
put(short key,
long value) |
|
void |
putAll(ShortLongMap map) |
|
void |
readExternal(ObjectInput in) |
|
ShortLongHashMap |
reject(ShortLongPredicate predicate) |
|
void |
remove(short key) |
|
void |
removeKey(short key) |
|
long |
removeKeyIfAbsent(short key,
long value) |
|
ShortLongHashMap |
select(ShortLongPredicate predicate) |
|
ImmutableShortLongMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
long |
updateValue(short key,
long initialValueIfAbsent,
LongToLongFunction function) |
|
void |
updateValues(ShortLongToLongFunction function) |
Updates the values in-place.
|
MutableLongCollection |
values() |
|
ShortLongHashMap |
withKeysValues(short key1,
long value1,
short key2,
long value2) |
|
ShortLongHashMap |
withKeysValues(short key1,
long value1,
short key2,
long value2,
short key3,
long value3) |
|
ShortLongHashMap |
withKeysValues(short key1,
long value1,
short key2,
long value2,
short key3,
long value3,
short key4,
long value4) |
|
ShortLongHashMap |
withKeyValue(short key1,
long value1) |
|
ShortLongHashMap |
withoutAllKeys(ShortIterable keys) |
|
ShortLongHashMap |
withoutKey(short 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
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
collect, reject, select
putPair, withAllKeyValues
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
isEmpty, notEmpty, size
public ShortLongHashMap()
public ShortLongHashMap(int initialCapacity)
public ShortLongHashMap(ShortLongMap map)
public static ShortLongHashMap newWithKeysValues(short key1, long value1)
public static ShortLongHashMap newWithKeysValues(short key1, long value1, short key2, long value2)
public static ShortLongHashMap newWithKeysValues(short key1, long value1, short key2, long value2, short key3, long value3)
public static ShortLongHashMap newWithKeysValues(short key1, long value1, short key2, long value2, short key3, long value3, short key4, long value4)
public boolean equals(Object obj)
ShortLongMap
Map.equals(Object)
.equals
in interface ShortLongMap
equals
in class Object
public int hashCode()
ShortLongMap
Map.hashCode()
.hashCode
in interface ShortLongMap
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 PrimitiveIterable
toString
in interface ShortLongMap
toString
in class AbstractLongIterable
AbstractCollection.toString()
public MutableLongIterator longIterator()
LongIterable
longIterator
in interface LongIterable
longIterator
in interface MutableLongValuesMap
public <V> V injectInto(V injectedValue, ObjectLongToObjectFunction<? super V,? extends V> function)
injectInto
in interface LongIterable
public void clear()
clear
in interface MutableLongValuesMap
clear
in interface MutableShortKeysMap
public void put(short key, long value)
put
in interface MutableShortLongMap
public void putAll(ShortLongMap map)
putAll
in interface MutableShortLongMap
public void updateValues(ShortLongToLongFunction function)
MutableShortLongMap
updateValues
in interface MutableShortLongMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(short key)
removeKey
in interface MutableShortKeysMap
removeKey
in interface MutableShortLongMap
public void remove(short key)
remove
in interface MutableShortLongMap
public long removeKeyIfAbsent(short key, long value)
removeKeyIfAbsent
in interface MutableShortLongMap
public long getIfAbsentPut(short key, long value)
getIfAbsentPut
in interface MutableShortLongMap
public long getIfAbsentPut(short key, LongFunction0 function)
getIfAbsentPut
in interface MutableShortLongMap
public <P> long getIfAbsentPutWith(short key, LongFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableShortLongMap
public long getIfAbsentPutWithKey(short key, ShortToLongFunction function)
getIfAbsentPutWithKey
in interface MutableShortLongMap
public long addToValue(short key, long toBeAdded)
addToValue
in interface MutableShortLongMap
public long updateValue(short key, long initialValueIfAbsent, LongToLongFunction function)
updateValue
in interface MutableShortLongMap
public ShortLongHashMap withKeyValue(short key1, long value1)
withKeyValue
in interface MutableShortLongMap
public ShortLongHashMap withKeysValues(short key1, long value1, short key2, long value2)
public ShortLongHashMap withKeysValues(short key1, long value1, short key2, long value2, short key3, long value3)
public ShortLongHashMap withKeysValues(short key1, long value1, short key2, long value2, short key3, long value3, short key4, long value4)
public ShortLongHashMap withoutKey(short key)
withoutKey
in interface MutableShortLongMap
public ShortLongHashMap withoutAllKeys(ShortIterable keys)
withoutAllKeys
in interface MutableShortLongMap
public MutableShortLongMap asUnmodifiable()
asUnmodifiable
in interface MutableShortLongMap
public MutableShortLongMap asSynchronized()
asSynchronized
in interface MutableShortLongMap
public ImmutableShortLongMap toImmutable()
toImmutable
in interface ShortLongMap
public long get(short key)
get
in interface ShortLongMap
public long getIfAbsent(short key, long ifAbsent)
getIfAbsent
in interface ShortLongMap
public long getOrThrow(short key)
getOrThrow
in interface ShortLongMap
public boolean containsKey(short key)
containsKey
in interface ShortKeysMap
containsKey
in interface ShortLongMap
public void forEachKey(ShortProcedure procedure)
forEachKey
in interface ShortKeysMap
forEachKey
in interface ShortLongMap
public void forEachKeyValue(ShortLongProcedure procedure)
forEachKeyValue
in interface ShortLongMap
public LazyShortIterable keysView()
keysView
in interface ShortLongMap
public RichIterable<ShortLongPair> keyValuesView()
keyValuesView
in interface ShortLongMap
public MutableLongShortMap flipUniqueValues()
ShortLongMap
flipUniqueValues
in interface MutableShortLongMap
flipUniqueValues
in interface ShortLongMap
public ShortLongHashMap select(ShortLongPredicate predicate)
select
in interface MutableShortLongMap
select
in interface ShortLongMap
public ShortLongHashMap reject(ShortLongPredicate predicate)
reject
in interface MutableShortLongMap
reject
in interface ShortLongMap
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 MutableShortSet keySet()
keySet
in interface ShortLongMap
public MutableLongCollection values()
values
in interface LongValuesMap
Copyright © 2004–2019. All rights reserved.