java.io.Externalizable
, java.io.Serializable
, IntIterable
, IntValuesMap
, LongIntMap
, MutableIntValuesMap
, MutableLongIntMap
, PrimitiveIterable
, MutableLongKeysMap
, LongKeysMap
public class LongIntHashMap extends AbstractMutableIntValuesMap implements MutableLongIntMap, java.io.Externalizable, MutableLongKeysMap
Constructor | Description |
---|---|
LongIntHashMap() |
|
LongIntHashMap(int initialCapacity) |
|
LongIntHashMap(LongIntMap map) |
Modifier and Type | Method | Description |
---|---|---|
int |
addToValue(long key,
int toBeAdded) |
|
MutableLongIntMap |
asSynchronized() |
|
MutableLongIntMap |
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(long key) |
|
boolean |
equals(java.lang.Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableIntLongMap |
flipUniqueValues() |
Return the IntLongMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(LongProcedure procedure) |
|
void |
forEachKeyValue(LongIntProcedure procedure) |
|
int |
get(long key) |
|
int |
getIfAbsent(long key,
int ifAbsent) |
|
int |
getIfAbsentPut(long key,
int value) |
|
int |
getIfAbsentPut(long key,
IntFunction0 function) |
|
<P> int |
getIfAbsentPutWith(long key,
IntFunction<? super P> function,
P parameter) |
|
int |
getIfAbsentPutWithKey(long key,
LongToIntFunction function) |
|
int |
getOrThrow(long 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.
|
MutableLongSet |
keySet() |
|
LazyLongIterable |
keysView() |
|
RichIterable<LongIntPair> |
keyValuesView() |
|
static LongIntHashMap |
newWithKeysValues(long key1,
int value1) |
|
static LongIntHashMap |
newWithKeysValues(long key1,
int value1,
long key2,
int value2) |
|
static LongIntHashMap |
newWithKeysValues(long key1,
int value1,
long key2,
int value2,
long key3,
int value3) |
|
static LongIntHashMap |
newWithKeysValues(long key1,
int value1,
long key2,
int value2,
long key3,
int value3,
long key4,
int value4) |
|
void |
put(long key,
int value) |
|
void |
putAll(LongIntMap map) |
|
void |
readExternal(java.io.ObjectInput in) |
|
LongIntHashMap |
reject(LongIntPredicate predicate) |
|
void |
remove(long key) |
|
void |
removeKey(long key) |
|
int |
removeKeyIfAbsent(long key,
int value) |
|
LongIntHashMap |
select(LongIntPredicate predicate) |
|
ImmutableLongIntMap |
toImmutable() |
|
java.lang.String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
int |
updateValue(long key,
int initialValueIfAbsent,
IntToIntFunction function) |
|
MutableIntCollection |
values() |
|
LongIntHashMap |
withKeysValues(long key1,
int value1,
long key2,
int value2) |
|
LongIntHashMap |
withKeysValues(long key1,
int value1,
long key2,
int value2,
long key3,
int value3) |
|
LongIntHashMap |
withKeysValues(long key1,
int value1,
long key2,
int value2,
long key3,
int value3,
long key4,
int value4) |
|
LongIntHashMap |
withKeyValue(long key1,
int value1) |
|
LongIntHashMap |
withoutAllKeys(LongIterable keys) |
|
LongIntHashMap |
withoutKey(long 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, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedList
containsValue, forEachValue, tap
isEmpty, notEmpty, size
collect, reject, select
putPair
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
public LongIntHashMap()
public LongIntHashMap(int initialCapacity)
public LongIntHashMap(LongIntMap map)
public static LongIntHashMap newWithKeysValues(long key1, int value1)
public static LongIntHashMap newWithKeysValues(long key1, int value1, long key2, int value2)
public static LongIntHashMap newWithKeysValues(long key1, int value1, long key2, int value2, long key3, int value3)
public static LongIntHashMap newWithKeysValues(long key1, int value1, long key2, int value2, long key3, int value3, long key4, int value4)
public boolean equals(java.lang.Object obj)
LongIntMap
Map.equals(Object)
.equals
in interface LongIntMap
equals
in class java.lang.Object
public int hashCode()
LongIntMap
Map.hashCode()
.hashCode
in interface LongIntMap
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 LongIntMap
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 MutableIntValuesMap
clear
in interface MutableLongKeysMap
public void put(long key, int value)
put
in interface MutableLongIntMap
public void putAll(LongIntMap map)
putAll
in interface MutableLongIntMap
public void removeKey(long key)
removeKey
in interface MutableLongIntMap
removeKey
in interface MutableLongKeysMap
public void remove(long key)
remove
in interface MutableLongIntMap
public int removeKeyIfAbsent(long key, int value)
removeKeyIfAbsent
in interface MutableLongIntMap
public int getIfAbsentPut(long key, int value)
getIfAbsentPut
in interface MutableLongIntMap
public int getIfAbsentPut(long key, IntFunction0 function)
getIfAbsentPut
in interface MutableLongIntMap
public <P> int getIfAbsentPutWith(long key, IntFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableLongIntMap
public int getIfAbsentPutWithKey(long key, LongToIntFunction function)
getIfAbsentPutWithKey
in interface MutableLongIntMap
public int addToValue(long key, int toBeAdded)
addToValue
in interface MutableLongIntMap
public int updateValue(long key, int initialValueIfAbsent, IntToIntFunction function)
updateValue
in interface MutableLongIntMap
public LongIntHashMap withKeyValue(long key1, int value1)
withKeyValue
in interface MutableLongIntMap
public LongIntHashMap withKeysValues(long key1, int value1, long key2, int value2)
public LongIntHashMap withKeysValues(long key1, int value1, long key2, int value2, long key3, int value3)
public LongIntHashMap withKeysValues(long key1, int value1, long key2, int value2, long key3, int value3, long key4, int value4)
public LongIntHashMap withoutKey(long key)
withoutKey
in interface MutableLongIntMap
public LongIntHashMap withoutAllKeys(LongIterable keys)
withoutAllKeys
in interface MutableLongIntMap
public MutableLongIntMap asUnmodifiable()
asUnmodifiable
in interface MutableLongIntMap
public MutableLongIntMap asSynchronized()
asSynchronized
in interface MutableLongIntMap
public ImmutableLongIntMap toImmutable()
toImmutable
in interface LongIntMap
public int get(long key)
get
in interface LongIntMap
public int getIfAbsent(long key, int ifAbsent)
getIfAbsent
in interface LongIntMap
public int getOrThrow(long key)
getOrThrow
in interface LongIntMap
public boolean containsKey(long key)
containsKey
in interface LongIntMap
containsKey
in interface LongKeysMap
public void forEachKey(LongProcedure procedure)
forEachKey
in interface LongIntMap
forEachKey
in interface LongKeysMap
public void forEachKeyValue(LongIntProcedure procedure)
forEachKeyValue
in interface LongIntMap
public LazyLongIterable keysView()
keysView
in interface LongIntMap
public RichIterable<LongIntPair> keyValuesView()
keyValuesView
in interface LongIntMap
public MutableIntLongMap flipUniqueValues()
LongIntMap
flipUniqueValues
in interface LongIntMap
flipUniqueValues
in interface MutableLongIntMap
public LongIntHashMap select(LongIntPredicate predicate)
select
in interface LongIntMap
select
in interface MutableLongIntMap
public LongIntHashMap reject(LongIntPredicate predicate)
reject
in interface LongIntMap
reject
in interface MutableLongIntMap
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 MutableLongSet keySet()
keySet
in interface LongIntMap
public MutableIntCollection values()
values
in interface IntValuesMap
Copyright © 2004–2018. All rights reserved.