java.io.Externalizable
, java.io.Serializable
, LongShortMap
, MutableLongShortMap
, MutableShortValuesMap
, ShortValuesMap
, PrimitiveIterable
, ShortIterable
, MutableLongKeysMap
, LongKeysMap
public class LongShortHashMap extends AbstractMutableShortValuesMap implements MutableLongShortMap, java.io.Externalizable, MutableLongKeysMap
Constructor | Description |
---|---|
LongShortHashMap() |
|
LongShortHashMap(int initialCapacity) |
|
LongShortHashMap(LongShortMap map) |
Modifier and Type | Method | Description |
---|---|---|
short |
addToValue(long key,
short toBeAdded) |
|
MutableLongShortMap |
asSynchronized() |
|
MutableLongShortMap |
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(long key) |
|
boolean |
equals(java.lang.Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableShortLongMap |
flipUniqueValues() |
Return the ShortLongMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(LongProcedure procedure) |
|
void |
forEachKeyValue(LongShortProcedure procedure) |
|
short |
get(long key) |
|
short |
getIfAbsent(long key,
short ifAbsent) |
|
short |
getIfAbsentPut(long key,
short value) |
|
short |
getIfAbsentPut(long key,
ShortFunction0 function) |
|
<P> short |
getIfAbsentPutWith(long key,
ShortFunction<? super P> function,
P parameter) |
|
short |
getIfAbsentPutWithKey(long key,
LongToShortFunction function) |
|
short |
getOrThrow(long key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectShortToObjectFunction<? super V,? extends V> function) |
|
MutableLongSet |
keySet() |
|
LazyLongIterable |
keysView() |
|
RichIterable<LongShortPair> |
keyValuesView() |
|
static LongShortHashMap |
newWithKeysValues(long key1,
short value1) |
|
static LongShortHashMap |
newWithKeysValues(long key1,
short value1,
long key2,
short value2) |
|
static LongShortHashMap |
newWithKeysValues(long key1,
short value1,
long key2,
short value2,
long key3,
short value3) |
|
static LongShortHashMap |
newWithKeysValues(long key1,
short value1,
long key2,
short value2,
long key3,
short value3,
long key4,
short value4) |
|
void |
put(long key,
short value) |
|
void |
putAll(LongShortMap map) |
|
void |
readExternal(java.io.ObjectInput in) |
|
LongShortHashMap |
reject(LongShortPredicate predicate) |
|
void |
remove(long key) |
|
void |
removeKey(long key) |
|
short |
removeKeyIfAbsent(long key,
short value) |
|
LongShortHashMap |
select(LongShortPredicate predicate) |
|
MutableShortIterator |
shortIterator() |
Returns a primitive iterator that can be used to iterate over the ShortIterable in an
imperative style.
|
ImmutableLongShortMap |
toImmutable() |
|
java.lang.String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
short |
updateValue(long key,
short initialValueIfAbsent,
ShortToShortFunction function) |
|
MutableShortCollection |
values() |
|
LongShortHashMap |
withKeysValues(long key1,
short value1,
long key2,
short value2) |
|
LongShortHashMap |
withKeysValues(long key1,
short value1,
long key2,
short value2,
long key3,
short value3) |
|
LongShortHashMap |
withKeysValues(long key1,
short value1,
long key2,
short value2,
long key3,
short value3,
long key4,
short value4) |
|
LongShortHashMap |
withKeyValue(long key1,
short value1) |
|
LongShortHashMap |
withoutAllKeys(LongIterable keys) |
|
LongShortHashMap |
withoutKey(long key) |
|
void |
writeExternal(java.io.ObjectOutput out) |
allSatisfy, anySatisfy, appendString, chunk, collect, contains, containsAll, containsValue, count, detectIfNone, each, forEach, forEachValue, isEmpty, max, min, noneSatisfy, notEmpty, reject, select, size, sum, toArray
asLazy, average, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList
isEmpty, notEmpty, size
putPair
collect, reject, select
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, 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, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedList
containsValue, forEachValue, tap
public LongShortHashMap()
public LongShortHashMap(int initialCapacity)
public LongShortHashMap(LongShortMap map)
public static LongShortHashMap newWithKeysValues(long key1, short value1)
public static LongShortHashMap newWithKeysValues(long key1, short value1, long key2, short value2)
public static LongShortHashMap newWithKeysValues(long key1, short value1, long key2, short value2, long key3, short value3)
public static LongShortHashMap newWithKeysValues(long key1, short value1, long key2, short value2, long key3, short value3, long key4, short value4)
public boolean equals(java.lang.Object obj)
LongShortMap
Map.equals(Object)
.equals
in interface LongShortMap
equals
in class java.lang.Object
public int hashCode()
LongShortMap
Map.hashCode()
.hashCode
in interface LongShortMap
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 LongShortMap
toString
in interface PrimitiveIterable
toString
in class AbstractShortIterable
AbstractCollection.toString()
public MutableShortIterator shortIterator()
ShortIterable
shortIterator
in interface MutableShortValuesMap
shortIterator
in interface ShortIterable
public <V> V injectInto(V injectedValue, ObjectShortToObjectFunction<? super V,? extends V> function)
injectInto
in interface ShortIterable
public void clear()
clear
in interface MutableLongKeysMap
clear
in interface MutableShortValuesMap
public void put(long key, short value)
put
in interface MutableLongShortMap
public void putAll(LongShortMap map)
putAll
in interface MutableLongShortMap
public void removeKey(long key)
removeKey
in interface MutableLongKeysMap
removeKey
in interface MutableLongShortMap
public void remove(long key)
remove
in interface MutableLongShortMap
public short removeKeyIfAbsent(long key, short value)
removeKeyIfAbsent
in interface MutableLongShortMap
public short getIfAbsentPut(long key, short value)
getIfAbsentPut
in interface MutableLongShortMap
public short getIfAbsentPut(long key, ShortFunction0 function)
getIfAbsentPut
in interface MutableLongShortMap
public <P> short getIfAbsentPutWith(long key, ShortFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableLongShortMap
public short getIfAbsentPutWithKey(long key, LongToShortFunction function)
getIfAbsentPutWithKey
in interface MutableLongShortMap
public short addToValue(long key, short toBeAdded)
addToValue
in interface MutableLongShortMap
public short updateValue(long key, short initialValueIfAbsent, ShortToShortFunction function)
updateValue
in interface MutableLongShortMap
public LongShortHashMap withKeyValue(long key1, short value1)
withKeyValue
in interface MutableLongShortMap
public LongShortHashMap withKeysValues(long key1, short value1, long key2, short value2)
public LongShortHashMap withKeysValues(long key1, short value1, long key2, short value2, long key3, short value3)
public LongShortHashMap withKeysValues(long key1, short value1, long key2, short value2, long key3, short value3, long key4, short value4)
public LongShortHashMap withoutKey(long key)
withoutKey
in interface MutableLongShortMap
public LongShortHashMap withoutAllKeys(LongIterable keys)
withoutAllKeys
in interface MutableLongShortMap
public MutableLongShortMap asUnmodifiable()
asUnmodifiable
in interface MutableLongShortMap
public MutableLongShortMap asSynchronized()
asSynchronized
in interface MutableLongShortMap
public ImmutableLongShortMap toImmutable()
toImmutable
in interface LongShortMap
public short get(long key)
get
in interface LongShortMap
public short getIfAbsent(long key, short ifAbsent)
getIfAbsent
in interface LongShortMap
public short getOrThrow(long key)
getOrThrow
in interface LongShortMap
public boolean containsKey(long key)
containsKey
in interface LongKeysMap
containsKey
in interface LongShortMap
public void forEachKey(LongProcedure procedure)
forEachKey
in interface LongKeysMap
forEachKey
in interface LongShortMap
public void forEachKeyValue(LongShortProcedure procedure)
forEachKeyValue
in interface LongShortMap
public LazyLongIterable keysView()
keysView
in interface LongShortMap
public RichIterable<LongShortPair> keyValuesView()
keyValuesView
in interface LongShortMap
public MutableShortLongMap flipUniqueValues()
LongShortMap
flipUniqueValues
in interface LongShortMap
flipUniqueValues
in interface MutableLongShortMap
public LongShortHashMap select(LongShortPredicate predicate)
select
in interface LongShortMap
select
in interface MutableLongShortMap
public LongShortHashMap reject(LongShortPredicate predicate)
reject
in interface LongShortMap
reject
in interface MutableLongShortMap
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 MutableLongSet keySet()
keySet
in interface LongShortMap
public MutableShortCollection values()
values
in interface ShortValuesMap
Copyright © 2004–2018. All rights reserved.