Externalizable
, Serializable
, LongIterable
, LongLongMap
, LongValuesMap
, MutableLongLongMap
, MutableLongValuesMap
, PrimitiveIterable
, MutableLongKeysMap
, LongKeysMap
public class LongLongHashMap extends AbstractMutableLongValuesMap implements MutableLongLongMap, Externalizable, MutableLongKeysMap
Constructor | Description |
---|---|
LongLongHashMap() |
|
LongLongHashMap(int initialCapacity) |
|
LongLongHashMap(LongLongMap map) |
Modifier and Type | Method | Description |
---|---|---|
long |
addToValue(long key,
long toBeAdded) |
|
MutableLongLongMap |
asSynchronized() |
|
MutableLongLongMap |
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(Object obj) |
Follows the same general contract as
Map.equals(Object) . |
MutableLongLongMap |
flipUniqueValues() |
Return the LongLongMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(LongProcedure procedure) |
|
void |
forEachKeyValue(LongLongProcedure procedure) |
|
long |
get(long key) |
|
long |
getIfAbsent(long key,
long ifAbsent) |
|
long |
getIfAbsentPut(long key,
long value) |
|
long |
getIfAbsentPut(long key,
LongFunction0 function) |
|
<P> long |
getIfAbsentPutWith(long key,
LongFunction<? super P> function,
P parameter) |
|
long |
getIfAbsentPutWithKey(long key,
LongToLongFunction function) |
|
long |
getOrThrow(long key) |
|
int |
hashCode() |
Follows the same general contract as
Map.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectLongToObjectFunction<? super V,? extends V> function) |
|
MutableLongSet |
keySet() |
|
LazyLongIterable |
keysView() |
|
RichIterable<LongLongPair> |
keyValuesView() |
|
MutableLongIterator |
longIterator() |
Returns a primitive iterator that can be used to iterate over the LongIterable in an
imperative style.
|
static LongLongHashMap |
newWithKeysValues(long key1,
long value1) |
|
static LongLongHashMap |
newWithKeysValues(long key1,
long value1,
long key2,
long value2) |
|
static LongLongHashMap |
newWithKeysValues(long key1,
long value1,
long key2,
long value2,
long key3,
long value3) |
|
static LongLongHashMap |
newWithKeysValues(long key1,
long value1,
long key2,
long value2,
long key3,
long value3,
long key4,
long value4) |
|
void |
put(long key,
long value) |
|
void |
putAll(LongLongMap map) |
|
void |
readExternal(ObjectInput in) |
|
LongLongHashMap |
reject(LongLongPredicate predicate) |
|
void |
remove(long key) |
|
void |
removeKey(long key) |
|
long |
removeKeyIfAbsent(long key,
long value) |
|
LongLongHashMap |
select(LongLongPredicate predicate) |
|
ImmutableLongLongMap |
toImmutable() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
long |
updateValue(long key,
long initialValueIfAbsent,
LongToLongFunction function) |
|
void |
updateValues(LongLongToLongFunction function) |
Updates the values in-place.
|
MutableLongCollection |
values() |
|
LongLongHashMap |
withKeysValues(long key1,
long value1,
long key2,
long value2) |
|
LongLongHashMap |
withKeysValues(long key1,
long value1,
long key2,
long value2,
long key3,
long value3) |
|
LongLongHashMap |
withKeysValues(long key1,
long value1,
long key2,
long value2,
long key3,
long value3,
long key4,
long value4) |
|
LongLongHashMap |
withKeyValue(long key1,
long value1) |
|
LongLongHashMap |
withoutAllKeys(LongIterable keys) |
|
LongLongHashMap |
withoutKey(long 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
isEmpty, notEmpty, size
containsValue, forEachValue, tap
putPair, withAllKeyValues
collect, reject, select
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
public LongLongHashMap()
public LongLongHashMap(int initialCapacity)
public LongLongHashMap(LongLongMap map)
public static LongLongHashMap newWithKeysValues(long key1, long value1)
public static LongLongHashMap newWithKeysValues(long key1, long value1, long key2, long value2)
public static LongLongHashMap newWithKeysValues(long key1, long value1, long key2, long value2, long key3, long value3)
public static LongLongHashMap newWithKeysValues(long key1, long value1, long key2, long value2, long key3, long value3, long key4, long value4)
public boolean equals(Object obj)
LongLongMap
Map.equals(Object)
.equals
in interface LongLongMap
equals
in class Object
public int hashCode()
LongLongMap
Map.hashCode()
.hashCode
in interface LongLongMap
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 LongLongMap
toString
in interface PrimitiveIterable
toString
in class AbstractLongIterable
AbstractCollection.toString()
public MutableLongIterator longIterator()
LongIterable
longIterator
in interface LongIterable
longIterator
in interface MutableLongValuesMap
public <V> V injectInto(V injectedValue, ObjectLongToObjectFunction<? super V,? extends V> function)
injectInto
in interface LongIterable
public void clear()
clear
in interface MutableLongKeysMap
clear
in interface MutableLongValuesMap
public void put(long key, long value)
put
in interface MutableLongLongMap
public void putAll(LongLongMap map)
putAll
in interface MutableLongLongMap
public void updateValues(LongLongToLongFunction function)
MutableLongLongMap
updateValues
in interface MutableLongLongMap
function
- that takes a key and its value and that returns a new value for this keypublic void removeKey(long key)
removeKey
in interface MutableLongKeysMap
removeKey
in interface MutableLongLongMap
public void remove(long key)
remove
in interface MutableLongLongMap
public long removeKeyIfAbsent(long key, long value)
removeKeyIfAbsent
in interface MutableLongLongMap
public long getIfAbsentPut(long key, long value)
getIfAbsentPut
in interface MutableLongLongMap
public long getIfAbsentPut(long key, LongFunction0 function)
getIfAbsentPut
in interface MutableLongLongMap
public <P> long getIfAbsentPutWith(long key, LongFunction<? super P> function, P parameter)
getIfAbsentPutWith
in interface MutableLongLongMap
public long getIfAbsentPutWithKey(long key, LongToLongFunction function)
getIfAbsentPutWithKey
in interface MutableLongLongMap
public long addToValue(long key, long toBeAdded)
addToValue
in interface MutableLongLongMap
public long updateValue(long key, long initialValueIfAbsent, LongToLongFunction function)
updateValue
in interface MutableLongLongMap
public LongLongHashMap withKeyValue(long key1, long value1)
withKeyValue
in interface MutableLongLongMap
public LongLongHashMap withKeysValues(long key1, long value1, long key2, long value2)
public LongLongHashMap withKeysValues(long key1, long value1, long key2, long value2, long key3, long value3)
public LongLongHashMap withKeysValues(long key1, long value1, long key2, long value2, long key3, long value3, long key4, long value4)
public LongLongHashMap withoutKey(long key)
withoutKey
in interface MutableLongLongMap
public LongLongHashMap withoutAllKeys(LongIterable keys)
withoutAllKeys
in interface MutableLongLongMap
public MutableLongLongMap asUnmodifiable()
asUnmodifiable
in interface MutableLongLongMap
public MutableLongLongMap asSynchronized()
asSynchronized
in interface MutableLongLongMap
public ImmutableLongLongMap toImmutable()
toImmutable
in interface LongLongMap
public long get(long key)
get
in interface LongLongMap
public long getIfAbsent(long key, long ifAbsent)
getIfAbsent
in interface LongLongMap
public long getOrThrow(long key)
getOrThrow
in interface LongLongMap
public boolean containsKey(long key)
containsKey
in interface LongKeysMap
containsKey
in interface LongLongMap
public void forEachKey(LongProcedure procedure)
forEachKey
in interface LongKeysMap
forEachKey
in interface LongLongMap
public void forEachKeyValue(LongLongProcedure procedure)
forEachKeyValue
in interface LongLongMap
public LazyLongIterable keysView()
keysView
in interface LongLongMap
public RichIterable<LongLongPair> keyValuesView()
keyValuesView
in interface LongLongMap
public MutableLongLongMap flipUniqueValues()
LongLongMap
flipUniqueValues
in interface LongLongMap
flipUniqueValues
in interface MutableLongLongMap
public LongLongHashMap select(LongLongPredicate predicate)
select
in interface LongLongMap
select
in interface MutableLongLongMap
public LongLongHashMap reject(LongLongPredicate predicate)
reject
in interface LongLongMap
reject
in interface MutableLongLongMap
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 MutableLongSet keySet()
keySet
in interface LongLongMap
public MutableLongCollection values()
values
in interface LongValuesMap
Copyright © 2004–2019. All rights reserved.