java.io.Externalizable
, java.io.Serializable
, CharIterable
, CharValuesMap
, IntCharMap
, MutableCharValuesMap
, MutableIntCharMap
, PrimitiveIterable
, MutableIntKeysMap
, IntKeysMap
public class IntCharHashMap extends AbstractMutableCharValuesMap implements MutableIntCharMap, java.io.Externalizable, MutableIntKeysMap
Constructor | Description |
---|---|
IntCharHashMap() |
|
IntCharHashMap(int initialCapacity) |
|
IntCharHashMap(IntCharMap map) |
Modifier and Type | Method | Description |
---|---|---|
char |
addToValue(int key,
char toBeAdded) |
|
MutableIntCharMap |
asSynchronized() |
|
MutableIntCharMap |
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(int key) |
|
boolean |
equals(java.lang.Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableCharIntMap |
flipUniqueValues() |
Return the CharIntMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(IntProcedure procedure) |
|
void |
forEachKeyValue(IntCharProcedure procedure) |
|
char |
get(int key) |
|
char |
getIfAbsent(int key,
char ifAbsent) |
|
char |
getIfAbsentPut(int key,
char value) |
|
char |
getIfAbsentPut(int key,
CharFunction0 function) |
|
<P> char |
getIfAbsentPutWith(int key,
CharFunction<? super P> function,
P parameter) |
|
char |
getIfAbsentPutWithKey(int key,
IntToCharFunction function) |
|
char |
getOrThrow(int key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectCharToObjectFunction<? super V,? extends V> function) |
|
MutableIntSet |
keySet() |
|
LazyIntIterable |
keysView() |
|
RichIterable<IntCharPair> |
keyValuesView() |
|
static IntCharHashMap |
newWithKeysValues(int key1,
char value1) |
|
static IntCharHashMap |
newWithKeysValues(int key1,
char value1,
int key2,
char value2) |
|
static IntCharHashMap |
newWithKeysValues(int key1,
char value1,
int key2,
char value2,
int key3,
char value3) |
|
static IntCharHashMap |
newWithKeysValues(int key1,
char value1,
int key2,
char value2,
int key3,
char value3,
int key4,
char value4) |
|
void |
put(int key,
char value) |
|
void |
putAll(IntCharMap map) |
|
void |
readExternal(java.io.ObjectInput in) |
|
IntCharHashMap |
reject(IntCharPredicate predicate) |
|
void |
remove(int key) |
|
void |
removeKey(int key) |
|
char |
removeKeyIfAbsent(int key,
char value) |
|
IntCharHashMap |
select(IntCharPredicate predicate) |
|
ImmutableIntCharMap |
toImmutable() |
|
java.lang.String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
char |
updateValue(int key,
char initialValueIfAbsent,
CharToCharFunction function) |
|
void |
updateValues(IntCharToCharFunction function) |
Updates the values in-place.
|
MutableCharCollection |
values() |
|
IntCharHashMap |
withKeysValues(int key1,
char value1,
int key2,
char value2) |
|
IntCharHashMap |
withKeysValues(int key1,
char value1,
int key2,
char value2,
int key3,
char value3) |
|
IntCharHashMap |
withKeysValues(int key1,
char value1,
int key2,
char value2,
int key3,
char value3,
int key4,
char value4) |
|
IntCharHashMap |
withKeyValue(int key1,
char value1) |
|
IntCharHashMap |
withoutAllKeys(IntIterable keys) |
|
IntCharHashMap |
withoutKey(int key) |
|
void |
writeExternal(java.io.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
isEmpty, notEmpty, size
collect, reject, select
putPair, withAllKeyValues
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
public IntCharHashMap()
public IntCharHashMap(int initialCapacity)
public IntCharHashMap(IntCharMap map)
public static IntCharHashMap newWithKeysValues(int key1, char value1)
public static IntCharHashMap newWithKeysValues(int key1, char value1, int key2, char value2)
public static IntCharHashMap newWithKeysValues(int key1, char value1, int key2, char value2, int key3, char value3)
public static IntCharHashMap newWithKeysValues(int key1, char value1, int key2, char value2, int key3, char value3, int key4, char value4)
public boolean equals(java.lang.Object obj)
IntCharMap
Map.equals(Object)
.equals
in interface IntCharMap
equals
in class java.lang.Object
public int hashCode()
IntCharMap
Map.hashCode()
.hashCode
in interface IntCharMap
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 IntCharMap
toString
in interface PrimitiveIterable
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 MutableIntKeysMap
public void put(int key, char value)
put
in interface MutableIntCharMap
public void putAll(IntCharMap map)
putAll
in interface MutableIntCharMap
public void updateValues(IntCharToCharFunction function)
MutableIntCharMap
updateValues
in interface MutableIntCharMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(int key)
removeKey
in interface MutableIntCharMap
removeKey
in interface MutableIntKeysMap
public void remove(int key)
remove
in interface MutableIntCharMap
public char removeKeyIfAbsent(int key, char value)
removeKeyIfAbsent
in interface MutableIntCharMap
public char getIfAbsentPut(int key, char value)
getIfAbsentPut
in interface MutableIntCharMap
public char getIfAbsentPut(int key, CharFunction0 function)
getIfAbsentPut
in interface MutableIntCharMap
public <P> char getIfAbsentPutWith(int key, CharFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableIntCharMap
public char getIfAbsentPutWithKey(int key, IntToCharFunction function)
getIfAbsentPutWithKey
in interface MutableIntCharMap
public char addToValue(int key, char toBeAdded)
addToValue
in interface MutableIntCharMap
public char updateValue(int key, char initialValueIfAbsent, CharToCharFunction function)
updateValue
in interface MutableIntCharMap
public IntCharHashMap withKeyValue(int key1, char value1)
withKeyValue
in interface MutableIntCharMap
public IntCharHashMap withKeysValues(int key1, char value1, int key2, char value2)
public IntCharHashMap withKeysValues(int key1, char value1, int key2, char value2, int key3, char value3)
public IntCharHashMap withKeysValues(int key1, char value1, int key2, char value2, int key3, char value3, int key4, char value4)
public IntCharHashMap withoutKey(int key)
withoutKey
in interface MutableIntCharMap
public IntCharHashMap withoutAllKeys(IntIterable keys)
withoutAllKeys
in interface MutableIntCharMap
public MutableIntCharMap asUnmodifiable()
asUnmodifiable
in interface MutableIntCharMap
public MutableIntCharMap asSynchronized()
asSynchronized
in interface MutableIntCharMap
public ImmutableIntCharMap toImmutable()
toImmutable
in interface IntCharMap
public char get(int key)
get
in interface IntCharMap
public char getIfAbsent(int key, char ifAbsent)
getIfAbsent
in interface IntCharMap
public char getOrThrow(int key)
getOrThrow
in interface IntCharMap
public boolean containsKey(int key)
containsKey
in interface IntCharMap
containsKey
in interface IntKeysMap
public void forEachKey(IntProcedure procedure)
forEachKey
in interface IntCharMap
forEachKey
in interface IntKeysMap
public void forEachKeyValue(IntCharProcedure procedure)
forEachKeyValue
in interface IntCharMap
public LazyIntIterable keysView()
keysView
in interface IntCharMap
public RichIterable<IntCharPair> keyValuesView()
keyValuesView
in interface IntCharMap
public MutableCharIntMap flipUniqueValues()
IntCharMap
flipUniqueValues
in interface IntCharMap
flipUniqueValues
in interface MutableIntCharMap
public IntCharHashMap select(IntCharPredicate predicate)
select
in interface IntCharMap
select
in interface MutableIntCharMap
public IntCharHashMap reject(IntCharPredicate predicate)
reject
in interface IntCharMap
reject
in interface MutableIntCharMap
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 MutableIntSet keySet()
keySet
in interface IntCharMap
public MutableCharCollection values()
values
in interface CharValuesMap
Copyright © 2004–2020. All rights reserved.