Externalizable
, Serializable
, IntIterable
, ByteIntMap
, IntValuesMap
, MutableByteIntMap
, MutableIntValuesMap
, PrimitiveIterable
, MutableByteKeysMap
, ByteKeysMap
public class ByteIntHashMap extends AbstractMutableIntValuesMap implements MutableByteIntMap, Externalizable, MutableByteKeysMap
Constructor | Description |
---|---|
ByteIntHashMap() |
|
ByteIntHashMap(int initialCapacity) |
|
ByteIntHashMap(ByteIntMap map) |
Modifier and Type | Method | Description |
---|---|---|
int |
addToValue(byte key,
int toBeAdded) |
|
MutableByteIntMap |
asSynchronized() |
|
MutableByteIntMap |
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) . |
MutableIntByteMap |
flipUniqueValues() |
Return the IntByteMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(ByteProcedure procedure) |
|
void |
forEachKeyValue(ByteIntProcedure procedure) |
|
int |
get(byte key) |
|
int |
getIfAbsent(byte key,
int ifAbsent) |
|
int |
getIfAbsentPut(byte key,
int value) |
|
int |
getIfAbsentPut(byte key,
IntFunction0 function) |
|
<P> int |
getIfAbsentPutWith(byte key,
IntFunction<? super P> function,
P parameter) |
|
int |
getIfAbsentPutWithKey(byte key,
ByteToIntFunction function) |
|
int |
getOrThrow(byte key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectIntToObjectFunction<? super V,? extends V> function) |
|
MutableIntIterator |
intIterator() |
Returns a primitive iterator that can be used to iterate over the IntIterable in an
imperative style.
|
MutableByteSet |
keySet() |
|
LazyByteIterable |
keysView() |
|
RichIterable<ByteIntPair> |
keyValuesView() |
|
static ByteIntHashMap |
newWithKeysValues(byte key1,
int value1) |
|
static ByteIntHashMap |
newWithKeysValues(byte key1,
int value1,
byte key2,
int value2) |
|
static ByteIntHashMap |
newWithKeysValues(byte key1,
int value1,
byte key2,
int value2,
byte key3,
int value3) |
|
static ByteIntHashMap |
newWithKeysValues(byte key1,
int value1,
byte key2,
int value2,
byte key3,
int value3,
byte key4,
int value4) |
|
void |
put(byte key,
int value) |
|
void |
putAll(ByteIntMap map) |
|
void |
readExternal(ObjectInput in) |
|
ByteIntHashMap |
reject(ByteIntPredicate predicate) |
|
void |
remove(byte key) |
|
void |
removeKey(byte key) |
|
int |
removeKeyIfAbsent(byte key,
int value) |
|
ByteIntHashMap |
select(ByteIntPredicate predicate) |
|
ImmutableByteIntMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
int |
updateValue(byte key,
int initialValueIfAbsent,
IntToIntFunction function) |
|
void |
updateValues(ByteIntToIntFunction function) |
Updates the values in-place.
|
MutableIntCollection |
values() |
|
ByteIntHashMap |
withKeysValues(byte key1,
int value1,
byte key2,
int value2) |
|
ByteIntHashMap |
withKeysValues(byte key1,
int value1,
byte key2,
int value2,
byte key3,
int value3) |
|
ByteIntHashMap |
withKeysValues(byte key1,
int value1,
byte key2,
int value2,
byte key3,
int value3,
byte key4,
int value4) |
|
ByteIntHashMap |
withKeyValue(byte key1,
int value1) |
|
ByteIntHashMap |
withoutAllKeys(ByteIterable keys) |
|
ByteIntHashMap |
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 ByteIntHashMap()
public ByteIntHashMap(int initialCapacity)
public ByteIntHashMap(ByteIntMap map)
public static ByteIntHashMap newWithKeysValues(byte key1, int value1)
public static ByteIntHashMap newWithKeysValues(byte key1, int value1, byte key2, int value2)
public static ByteIntHashMap newWithKeysValues(byte key1, int value1, byte key2, int value2, byte key3, int value3)
public static ByteIntHashMap newWithKeysValues(byte key1, int value1, byte key2, int value2, byte key3, int value3, byte key4, int value4)
public boolean equals(Object obj)
ByteIntMap
Map.equals(Object)
.equals
in interface ByteIntMap
equals
in class Object
public int hashCode()
ByteIntMap
Map.hashCode()
.hashCode
in interface ByteIntMap
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 ByteIntMap
toString
in interface PrimitiveIterable
toString
in class AbstractIntIterable
AbstractCollection.toString()
public MutableIntIterator intIterator()
IntIterable
intIterator
in interface IntIterable
intIterator
in interface MutableIntValuesMap
public <V> V injectInto(V injectedValue, ObjectIntToObjectFunction<? super V,? extends V> function)
injectInto
in interface IntIterable
public void clear()
clear
in interface MutableByteKeysMap
clear
in interface MutableIntValuesMap
public void put(byte key, int value)
put
in interface MutableByteIntMap
public void putAll(ByteIntMap map)
putAll
in interface MutableByteIntMap
public void updateValues(ByteIntToIntFunction function)
MutableByteIntMap
updateValues
in interface MutableByteIntMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(byte key)
removeKey
in interface MutableByteIntMap
removeKey
in interface MutableByteKeysMap
public void remove(byte key)
remove
in interface MutableByteIntMap
public int removeKeyIfAbsent(byte key, int value)
removeKeyIfAbsent
in interface MutableByteIntMap
public int getIfAbsentPut(byte key, int value)
getIfAbsentPut
in interface MutableByteIntMap
public int getIfAbsentPut(byte key, IntFunction0 function)
getIfAbsentPut
in interface MutableByteIntMap
public <P> int getIfAbsentPutWith(byte key, IntFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableByteIntMap
public int getIfAbsentPutWithKey(byte key, ByteToIntFunction function)
getIfAbsentPutWithKey
in interface MutableByteIntMap
public int addToValue(byte key, int toBeAdded)
addToValue
in interface MutableByteIntMap
public int updateValue(byte key, int initialValueIfAbsent, IntToIntFunction function)
updateValue
in interface MutableByteIntMap
public ByteIntHashMap withKeyValue(byte key1, int value1)
withKeyValue
in interface MutableByteIntMap
public ByteIntHashMap withKeysValues(byte key1, int value1, byte key2, int value2)
public ByteIntHashMap withKeysValues(byte key1, int value1, byte key2, int value2, byte key3, int value3)
public ByteIntHashMap withKeysValues(byte key1, int value1, byte key2, int value2, byte key3, int value3, byte key4, int value4)
public ByteIntHashMap withoutKey(byte key)
withoutKey
in interface MutableByteIntMap
public ByteIntHashMap withoutAllKeys(ByteIterable keys)
withoutAllKeys
in interface MutableByteIntMap
public MutableByteIntMap asUnmodifiable()
asUnmodifiable
in interface MutableByteIntMap
public MutableByteIntMap asSynchronized()
asSynchronized
in interface MutableByteIntMap
public ImmutableByteIntMap toImmutable()
toImmutable
in interface ByteIntMap
public int get(byte key)
get
in interface ByteIntMap
public int getIfAbsent(byte key, int ifAbsent)
getIfAbsent
in interface ByteIntMap
public int getOrThrow(byte key)
getOrThrow
in interface ByteIntMap
public boolean containsKey(byte key)
containsKey
in interface ByteIntMap
containsKey
in interface ByteKeysMap
public void forEachKey(ByteProcedure procedure)
forEachKey
in interface ByteIntMap
forEachKey
in interface ByteKeysMap
public void forEachKeyValue(ByteIntProcedure procedure)
forEachKeyValue
in interface ByteIntMap
public LazyByteIterable keysView()
keysView
in interface ByteIntMap
public RichIterable<ByteIntPair> keyValuesView()
keyValuesView
in interface ByteIntMap
public MutableIntByteMap flipUniqueValues()
ByteIntMap
flipUniqueValues
in interface ByteIntMap
flipUniqueValues
in interface MutableByteIntMap
public ByteIntHashMap select(ByteIntPredicate predicate)
select
in interface ByteIntMap
select
in interface MutableByteIntMap
public ByteIntHashMap reject(ByteIntPredicate predicate)
reject
in interface ByteIntMap
reject
in interface MutableByteIntMap
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 ByteIntMap
public MutableIntCollection values()
values
in interface IntValuesMap
Copyright © 2004–2019. All rights reserved.