Externalizable
, Serializable
, ByteShortMap
, MutableByteShortMap
, MutableShortValuesMap
, ShortValuesMap
, PrimitiveIterable
, ShortIterable
, MutableByteKeysMap
, ByteKeysMap
public class ByteShortHashMap extends AbstractMutableShortValuesMap implements MutableByteShortMap, Externalizable, MutableByteKeysMap
Constructor | Description |
---|---|
ByteShortHashMap() |
|
ByteShortHashMap(int initialCapacity) |
|
ByteShortHashMap(ByteShortMap map) |
Modifier and Type | Method | Description |
---|---|---|
short |
addToValue(byte key,
short toBeAdded) |
|
MutableByteShortMap |
asSynchronized() |
|
MutableByteShortMap |
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) |
|
boolean |
equals(Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableShortByteMap |
flipUniqueValues() |
Return the ShortByteMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(ByteProcedure procedure) |
|
void |
forEachKeyValue(ByteShortProcedure procedure) |
|
short |
get(byte key) |
|
short |
getIfAbsent(byte key,
short ifAbsent) |
|
short |
getIfAbsentPut(byte key,
short value) |
|
short |
getIfAbsentPut(byte key,
ShortFunction0 function) |
|
<P> short |
getIfAbsentPutWith(byte key,
ShortFunction<? super P> function,
P parameter) |
|
short |
getIfAbsentPutWithKey(byte key,
ByteToShortFunction function) |
|
short |
getOrThrow(byte key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectShortToObjectFunction<? super V,? extends V> function) |
|
MutableByteSet |
keySet() |
|
LazyByteIterable |
keysView() |
|
RichIterable<ByteShortPair> |
keyValuesView() |
|
static ByteShortHashMap |
newWithKeysValues(byte key1,
short value1) |
|
static ByteShortHashMap |
newWithKeysValues(byte key1,
short value1,
byte key2,
short value2) |
|
static ByteShortHashMap |
newWithKeysValues(byte key1,
short value1,
byte key2,
short value2,
byte key3,
short value3) |
|
static ByteShortHashMap |
newWithKeysValues(byte key1,
short value1,
byte key2,
short value2,
byte key3,
short value3,
byte key4,
short value4) |
|
void |
put(byte key,
short value) |
|
void |
putAll(ByteShortMap map) |
|
void |
readExternal(ObjectInput in) |
|
ByteShortHashMap |
reject(ByteShortPredicate predicate) |
|
void |
remove(byte key) |
|
void |
removeKey(byte key) |
|
short |
removeKeyIfAbsent(byte key,
short value) |
|
ByteShortHashMap |
select(ByteShortPredicate predicate) |
|
MutableShortIterator |
shortIterator() |
Returns a primitive iterator that can be used to iterate over the ShortIterable in an
imperative style.
|
ImmutableByteShortMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
short |
updateValue(byte key,
short initialValueIfAbsent,
ShortToShortFunction function) |
|
void |
updateValues(ByteShortToShortFunction function) |
Updates the values in-place.
|
MutableShortCollection |
values() |
|
ByteShortHashMap |
withKeysValues(byte key1,
short value1,
byte key2,
short value2) |
|
ByteShortHashMap |
withKeysValues(byte key1,
short value1,
byte key2,
short value2,
byte key3,
short value3) |
|
ByteShortHashMap |
withKeysValues(byte key1,
short value1,
byte key2,
short value2,
byte key3,
short value3,
byte key4,
short value4) |
|
ByteShortHashMap |
withKeyValue(byte key1,
short value1) |
|
ByteShortHashMap |
withoutAllKeys(ByteIterable keys) |
|
ByteShortHashMap |
withoutKey(byte 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
isEmpty, notEmpty, size
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
containsValue, forEachValue, tap
public ByteShortHashMap()
public ByteShortHashMap(int initialCapacity)
public ByteShortHashMap(ByteShortMap map)
public static ByteShortHashMap newWithKeysValues(byte key1, short value1)
public static ByteShortHashMap newWithKeysValues(byte key1, short value1, byte key2, short value2)
public static ByteShortHashMap newWithKeysValues(byte key1, short value1, byte key2, short value2, byte key3, short value3)
public static ByteShortHashMap newWithKeysValues(byte key1, short value1, byte key2, short value2, byte key3, short value3, byte key4, short value4)
public boolean equals(Object obj)
ByteShortMap
Map.equals(Object)
.equals
in interface ByteShortMap
equals
in class Object
public int hashCode()
ByteShortMap
Map.hashCode()
.hashCode
in interface ByteShortMap
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 ByteShortMap
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 MutableByteKeysMap
clear
in interface MutableShortValuesMap
public void put(byte key, short value)
put
in interface MutableByteShortMap
public void putAll(ByteShortMap map)
putAll
in interface MutableByteShortMap
public void updateValues(ByteShortToShortFunction function)
MutableByteShortMap
updateValues
in interface MutableByteShortMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(byte key)
removeKey
in interface MutableByteKeysMap
removeKey
in interface MutableByteShortMap
public void remove(byte key)
remove
in interface MutableByteShortMap
public short removeKeyIfAbsent(byte key, short value)
removeKeyIfAbsent
in interface MutableByteShortMap
public short getIfAbsentPut(byte key, short value)
getIfAbsentPut
in interface MutableByteShortMap
public short getIfAbsentPut(byte key, ShortFunction0 function)
getIfAbsentPut
in interface MutableByteShortMap
public <P> short getIfAbsentPutWith(byte key, ShortFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableByteShortMap
public short getIfAbsentPutWithKey(byte key, ByteToShortFunction function)
getIfAbsentPutWithKey
in interface MutableByteShortMap
public short addToValue(byte key, short toBeAdded)
addToValue
in interface MutableByteShortMap
public short updateValue(byte key, short initialValueIfAbsent, ShortToShortFunction function)
updateValue
in interface MutableByteShortMap
public ByteShortHashMap withKeyValue(byte key1, short value1)
withKeyValue
in interface MutableByteShortMap
public ByteShortHashMap withKeysValues(byte key1, short value1, byte key2, short value2)
public ByteShortHashMap withKeysValues(byte key1, short value1, byte key2, short value2, byte key3, short value3)
public ByteShortHashMap withKeysValues(byte key1, short value1, byte key2, short value2, byte key3, short value3, byte key4, short value4)
public ByteShortHashMap withoutKey(byte key)
withoutKey
in interface MutableByteShortMap
public ByteShortHashMap withoutAllKeys(ByteIterable keys)
withoutAllKeys
in interface MutableByteShortMap
public MutableByteShortMap asUnmodifiable()
asUnmodifiable
in interface MutableByteShortMap
public MutableByteShortMap asSynchronized()
asSynchronized
in interface MutableByteShortMap
public ImmutableByteShortMap toImmutable()
toImmutable
in interface ByteShortMap
public short get(byte key)
get
in interface ByteShortMap
public short getIfAbsent(byte key, short ifAbsent)
getIfAbsent
in interface ByteShortMap
public short getOrThrow(byte key)
getOrThrow
in interface ByteShortMap
public boolean containsKey(byte key)
containsKey
in interface ByteKeysMap
containsKey
in interface ByteShortMap
public void forEachKey(ByteProcedure procedure)
forEachKey
in interface ByteKeysMap
forEachKey
in interface ByteShortMap
public void forEachKeyValue(ByteShortProcedure procedure)
forEachKeyValue
in interface ByteShortMap
public LazyByteIterable keysView()
keysView
in interface ByteShortMap
public RichIterable<ByteShortPair> keyValuesView()
keyValuesView
in interface ByteShortMap
public MutableShortByteMap flipUniqueValues()
ByteShortMap
flipUniqueValues
in interface ByteShortMap
flipUniqueValues
in interface MutableByteShortMap
public ByteShortHashMap select(ByteShortPredicate predicate)
select
in interface ByteShortMap
select
in interface MutableByteShortMap
public ByteShortHashMap reject(ByteShortPredicate predicate)
reject
in interface ByteShortMap
reject
in interface MutableByteShortMap
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 ByteShortMap
public MutableShortCollection values()
values
in interface ShortValuesMap
Copyright © 2004–2019. All rights reserved.