Externalizable
, Serializable
, CharIterable
, CharValuesMap
, MutableCharValuesMap
, MutableShortCharMap
, ShortCharMap
, PrimitiveIterable
, MutableShortKeysMap
, ShortKeysMap
public class ShortCharHashMap extends AbstractMutableCharValuesMap implements MutableShortCharMap, Externalizable, MutableShortKeysMap
Constructor | Description |
---|---|
ShortCharHashMap() |
|
ShortCharHashMap(int initialCapacity) |
|
ShortCharHashMap(ShortCharMap map) |
Modifier and Type | Method | Description |
---|---|---|
char |
addToValue(short key,
char toBeAdded) |
|
MutableShortCharMap |
asSynchronized() |
|
MutableShortCharMap |
asUnmodifiable() |
|
MutableCharIterator |
charIterator() |
Returns a primitive iterator that can be used to iterate over the CharIterable in an
imperative style.
|
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) . |
MutableCharShortMap |
flipUniqueValues() |
Return the CharShortMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(ShortProcedure procedure) |
|
void |
forEachKeyValue(ShortCharProcedure procedure) |
|
char |
get(short key) |
|
char |
getIfAbsent(short key,
char ifAbsent) |
|
char |
getIfAbsentPut(short key,
char value) |
|
char |
getIfAbsentPut(short key,
CharFunction0 function) |
|
<P> char |
getIfAbsentPutWith(short key,
CharFunction<? super P> function,
P parameter) |
|
char |
getIfAbsentPutWithKey(short key,
ShortToCharFunction function) |
|
char |
getOrThrow(short key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectCharToObjectFunction<? super V,? extends V> function) |
|
MutableShortSet |
keySet() |
|
LazyShortIterable |
keysView() |
|
RichIterable<ShortCharPair> |
keyValuesView() |
|
static ShortCharHashMap |
newWithKeysValues(short key1,
char value1) |
|
static ShortCharHashMap |
newWithKeysValues(short key1,
char value1,
short key2,
char value2) |
|
static ShortCharHashMap |
newWithKeysValues(short key1,
char value1,
short key2,
char value2,
short key3,
char value3) |
|
static ShortCharHashMap |
newWithKeysValues(short key1,
char value1,
short key2,
char value2,
short key3,
char value3,
short key4,
char value4) |
|
void |
put(short key,
char value) |
|
void |
putAll(ShortCharMap map) |
|
void |
readExternal(ObjectInput in) |
|
ShortCharHashMap |
reject(ShortCharPredicate predicate) |
|
void |
remove(short key) |
|
void |
removeKey(short key) |
|
char |
removeKeyIfAbsent(short key,
char value) |
|
ShortCharHashMap |
select(ShortCharPredicate predicate) |
|
ImmutableShortCharMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
char |
updateValue(short key,
char initialValueIfAbsent,
CharToCharFunction function) |
|
void |
updateValues(ShortCharToCharFunction function) |
Updates the values in-place.
|
MutableCharCollection |
values() |
|
ShortCharHashMap |
withKeysValues(short key1,
char value1,
short key2,
char value2) |
|
ShortCharHashMap |
withKeysValues(short key1,
char value1,
short key2,
char value2,
short key3,
char value3) |
|
ShortCharHashMap |
withKeysValues(short key1,
char value1,
short key2,
char value2,
short key3,
char value3,
short key4,
char value4) |
|
ShortCharHashMap |
withKeyValue(short key1,
char value1) |
|
ShortCharHashMap |
withoutAllKeys(ShortIterable keys) |
|
ShortCharHashMap |
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 ShortCharHashMap()
public ShortCharHashMap(int initialCapacity)
public ShortCharHashMap(ShortCharMap map)
public static ShortCharHashMap newWithKeysValues(short key1, char value1)
public static ShortCharHashMap newWithKeysValues(short key1, char value1, short key2, char value2)
public static ShortCharHashMap newWithKeysValues(short key1, char value1, short key2, char value2, short key3, char value3)
public static ShortCharHashMap newWithKeysValues(short key1, char value1, short key2, char value2, short key3, char value3, short key4, char value4)
public boolean equals(Object obj)
ShortCharMap
Map.equals(Object)
.equals
in interface ShortCharMap
equals
in class Object
public int hashCode()
ShortCharMap
Map.hashCode()
.hashCode
in interface ShortCharMap
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 ShortCharMap
toString
in class AbstractCharIterable
AbstractCollection.toString()
public MutableCharIterator charIterator()
CharIterable
charIterator
in interface CharIterable
charIterator
in interface MutableCharValuesMap
public <V> V injectInto(V injectedValue, ObjectCharToObjectFunction<? super V,? extends V> function)
injectInto
in interface CharIterable
public void clear()
clear
in interface MutableCharValuesMap
clear
in interface MutableShortKeysMap
public void put(short key, char value)
put
in interface MutableShortCharMap
public void putAll(ShortCharMap map)
putAll
in interface MutableShortCharMap
public void updateValues(ShortCharToCharFunction function)
MutableShortCharMap
updateValues
in interface MutableShortCharMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(short key)
removeKey
in interface MutableShortCharMap
removeKey
in interface MutableShortKeysMap
public void remove(short key)
remove
in interface MutableShortCharMap
public char removeKeyIfAbsent(short key, char value)
removeKeyIfAbsent
in interface MutableShortCharMap
public char getIfAbsentPut(short key, char value)
getIfAbsentPut
in interface MutableShortCharMap
public char getIfAbsentPut(short key, CharFunction0 function)
getIfAbsentPut
in interface MutableShortCharMap
public <P> char getIfAbsentPutWith(short key, CharFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableShortCharMap
public char getIfAbsentPutWithKey(short key, ShortToCharFunction function)
getIfAbsentPutWithKey
in interface MutableShortCharMap
public char addToValue(short key, char toBeAdded)
addToValue
in interface MutableShortCharMap
public char updateValue(short key, char initialValueIfAbsent, CharToCharFunction function)
updateValue
in interface MutableShortCharMap
public ShortCharHashMap withKeyValue(short key1, char value1)
withKeyValue
in interface MutableShortCharMap
public ShortCharHashMap withKeysValues(short key1, char value1, short key2, char value2)
public ShortCharHashMap withKeysValues(short key1, char value1, short key2, char value2, short key3, char value3)
public ShortCharHashMap withKeysValues(short key1, char value1, short key2, char value2, short key3, char value3, short key4, char value4)
public ShortCharHashMap withoutKey(short key)
withoutKey
in interface MutableShortCharMap
public ShortCharHashMap withoutAllKeys(ShortIterable keys)
withoutAllKeys
in interface MutableShortCharMap
public MutableShortCharMap asUnmodifiable()
asUnmodifiable
in interface MutableShortCharMap
public MutableShortCharMap asSynchronized()
asSynchronized
in interface MutableShortCharMap
public ImmutableShortCharMap toImmutable()
toImmutable
in interface ShortCharMap
public char get(short key)
get
in interface ShortCharMap
public char getIfAbsent(short key, char ifAbsent)
getIfAbsent
in interface ShortCharMap
public char getOrThrow(short key)
getOrThrow
in interface ShortCharMap
public boolean containsKey(short key)
containsKey
in interface ShortCharMap
containsKey
in interface ShortKeysMap
public void forEachKey(ShortProcedure procedure)
forEachKey
in interface ShortCharMap
forEachKey
in interface ShortKeysMap
public void forEachKeyValue(ShortCharProcedure procedure)
forEachKeyValue
in interface ShortCharMap
public LazyShortIterable keysView()
keysView
in interface ShortCharMap
public RichIterable<ShortCharPair> keyValuesView()
keyValuesView
in interface ShortCharMap
public MutableCharShortMap flipUniqueValues()
ShortCharMap
flipUniqueValues
in interface MutableShortCharMap
flipUniqueValues
in interface ShortCharMap
public ShortCharHashMap select(ShortCharPredicate predicate)
select
in interface MutableShortCharMap
select
in interface ShortCharMap
public ShortCharHashMap reject(ShortCharPredicate predicate)
reject
in interface MutableShortCharMap
reject
in interface ShortCharMap
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 ShortCharMap
public MutableCharCollection values()
values
in interface CharValuesMap
Copyright © 2004–2019. All rights reserved.