Externalizable
, Serializable
, MutableShortShortMap
, MutableShortValuesMap
, ShortShortMap
, ShortValuesMap
, PrimitiveIterable
, ShortIterable
, MutableShortKeysMap
, ShortKeysMap
public class ShortShortHashMap extends AbstractMutableShortValuesMap implements MutableShortShortMap, Externalizable, MutableShortKeysMap
Constructor | Description |
---|---|
ShortShortHashMap() |
|
ShortShortHashMap(int initialCapacity) |
|
ShortShortHashMap(ShortShortMap map) |
Modifier and Type | Method | Description |
---|---|---|
short |
addToValue(short key,
short toBeAdded) |
|
MutableShortShortMap |
asSynchronized() |
|
MutableShortShortMap |
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) . |
MutableShortShortMap |
flipUniqueValues() |
Return the ShortShortMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(ShortProcedure procedure) |
|
void |
forEachKeyValue(ShortShortProcedure procedure) |
|
short |
get(short key) |
|
short |
getIfAbsent(short key,
short ifAbsent) |
|
short |
getIfAbsentPut(short key,
short value) |
|
short |
getIfAbsentPut(short key,
ShortFunction0 function) |
|
<P> short |
getIfAbsentPutWith(short key,
ShortFunction<? super P> function,
P parameter) |
|
short |
getIfAbsentPutWithKey(short key,
ShortToShortFunction function) |
|
short |
getOrThrow(short key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectShortToObjectFunction<? super V,? extends V> function) |
|
MutableShortSet |
keySet() |
|
LazyShortIterable |
keysView() |
|
RichIterable<ShortShortPair> |
keyValuesView() |
|
static ShortShortHashMap |
newWithKeysValues(short key1,
short value1) |
|
static ShortShortHashMap |
newWithKeysValues(short key1,
short value1,
short key2,
short value2) |
|
static ShortShortHashMap |
newWithKeysValues(short key1,
short value1,
short key2,
short value2,
short key3,
short value3) |
|
static ShortShortHashMap |
newWithKeysValues(short key1,
short value1,
short key2,
short value2,
short key3,
short value3,
short key4,
short value4) |
|
void |
put(short key,
short value) |
|
void |
putAll(ShortShortMap map) |
|
void |
readExternal(ObjectInput in) |
|
ShortShortHashMap |
reject(ShortShortPredicate predicate) |
|
void |
remove(short key) |
|
void |
removeKey(short key) |
|
short |
removeKeyIfAbsent(short key,
short value) |
|
ShortShortHashMap |
select(ShortShortPredicate predicate) |
|
MutableShortIterator |
shortIterator() |
Returns a primitive iterator that can be used to iterate over the ShortIterable in an
imperative style.
|
ImmutableShortShortMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
short |
updateValue(short key,
short initialValueIfAbsent,
ShortToShortFunction function) |
|
void |
updateValues(ShortShortToShortFunction function) |
Updates the values in-place.
|
MutableShortCollection |
values() |
|
ShortShortHashMap |
withKeysValues(short key1,
short value1,
short key2,
short value2) |
|
ShortShortHashMap |
withKeysValues(short key1,
short value1,
short key2,
short value2,
short key3,
short value3) |
|
ShortShortHashMap |
withKeysValues(short key1,
short value1,
short key2,
short value2,
short key3,
short value3,
short key4,
short value4) |
|
ShortShortHashMap |
withKeyValue(short key1,
short value1) |
|
ShortShortHashMap |
withoutAllKeys(ShortIterable keys) |
|
ShortShortHashMap |
withoutKey(short key) |
|
void |
writeExternal(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
putPair, withAllKeyValues
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, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedList
isEmpty, notEmpty, size
containsValue, forEachValue, tap
public ShortShortHashMap()
public ShortShortHashMap(int initialCapacity)
public ShortShortHashMap(ShortShortMap map)
public static ShortShortHashMap newWithKeysValues(short key1, short value1)
public static ShortShortHashMap newWithKeysValues(short key1, short value1, short key2, short value2)
public static ShortShortHashMap newWithKeysValues(short key1, short value1, short key2, short value2, short key3, short value3)
public static ShortShortHashMap newWithKeysValues(short key1, short value1, short key2, short value2, short key3, short value3, short key4, short value4)
public boolean equals(Object obj)
ShortShortMap
Map.equals(Object)
.equals
in interface ShortShortMap
equals
in class Object
public int hashCode()
ShortShortMap
Map.hashCode()
.hashCode
in interface ShortShortMap
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 ShortShortMap
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 MutableShortKeysMap
clear
in interface MutableShortValuesMap
public void put(short key, short value)
put
in interface MutableShortShortMap
public void putAll(ShortShortMap map)
putAll
in interface MutableShortShortMap
public void updateValues(ShortShortToShortFunction function)
MutableShortShortMap
updateValues
in interface MutableShortShortMap
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 MutableShortShortMap
public void remove(short key)
remove
in interface MutableShortShortMap
public short removeKeyIfAbsent(short key, short value)
removeKeyIfAbsent
in interface MutableShortShortMap
public short getIfAbsentPut(short key, short value)
getIfAbsentPut
in interface MutableShortShortMap
public short getIfAbsentPut(short key, ShortFunction0 function)
getIfAbsentPut
in interface MutableShortShortMap
public <P> short getIfAbsentPutWith(short key, ShortFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableShortShortMap
public short getIfAbsentPutWithKey(short key, ShortToShortFunction function)
getIfAbsentPutWithKey
in interface MutableShortShortMap
public short addToValue(short key, short toBeAdded)
addToValue
in interface MutableShortShortMap
public short updateValue(short key, short initialValueIfAbsent, ShortToShortFunction function)
updateValue
in interface MutableShortShortMap
public ShortShortHashMap withKeyValue(short key1, short value1)
withKeyValue
in interface MutableShortShortMap
public ShortShortHashMap withKeysValues(short key1, short value1, short key2, short value2)
public ShortShortHashMap withKeysValues(short key1, short value1, short key2, short value2, short key3, short value3)
public ShortShortHashMap withKeysValues(short key1, short value1, short key2, short value2, short key3, short value3, short key4, short value4)
public ShortShortHashMap withoutKey(short key)
withoutKey
in interface MutableShortShortMap
public ShortShortHashMap withoutAllKeys(ShortIterable keys)
withoutAllKeys
in interface MutableShortShortMap
public MutableShortShortMap asUnmodifiable()
asUnmodifiable
in interface MutableShortShortMap
public MutableShortShortMap asSynchronized()
asSynchronized
in interface MutableShortShortMap
public ImmutableShortShortMap toImmutable()
toImmutable
in interface ShortShortMap
public short get(short key)
get
in interface ShortShortMap
public short getIfAbsent(short key, short ifAbsent)
getIfAbsent
in interface ShortShortMap
public short getOrThrow(short key)
getOrThrow
in interface ShortShortMap
public boolean containsKey(short key)
containsKey
in interface ShortKeysMap
containsKey
in interface ShortShortMap
public void forEachKey(ShortProcedure procedure)
forEachKey
in interface ShortKeysMap
forEachKey
in interface ShortShortMap
public void forEachKeyValue(ShortShortProcedure procedure)
forEachKeyValue
in interface ShortShortMap
public LazyShortIterable keysView()
keysView
in interface ShortShortMap
public RichIterable<ShortShortPair> keyValuesView()
keyValuesView
in interface ShortShortMap
public MutableShortShortMap flipUniqueValues()
ShortShortMap
flipUniqueValues
in interface MutableShortShortMap
flipUniqueValues
in interface ShortShortMap
public ShortShortHashMap select(ShortShortPredicate predicate)
select
in interface MutableShortShortMap
select
in interface ShortShortMap
public ShortShortHashMap reject(ShortShortPredicate predicate)
reject
in interface MutableShortShortMap
reject
in interface ShortShortMap
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 ShortShortMap
public MutableShortCollection values()
values
in interface ShortValuesMap
Copyright © 2004–2019. All rights reserved.