Class ObjectLongHashMap<K>
- java.lang.Object
-
- org.eclipse.collections.impl.map.mutable.primitive.ObjectLongHashMap<K>
-
- All Implemented Interfaces:
Externalizable
,Serializable
,LongIterable
,MutableObjectLongMap<K>
,ObjectLongMap<K>
,PrimitiveIterable
public class ObjectLongHashMap<K> extends Object implements MutableObjectLongMap<K>, Externalizable
This file was automatically generated from template file objectPrimitiveHashMap.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static long
EMPTY_VALUE
-
Constructor Summary
Constructors Constructor Description ObjectLongHashMap()
ObjectLongHashMap(int initialCapacity)
ObjectLongHashMap(ObjectLongMap<? extends K> map)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
addToValue(K key, long toBeAdded)
boolean
allSatisfy(LongPredicate predicate)
boolean
anySatisfy(LongPredicate predicate)
void
appendString(Appendable appendable)
void
appendString(Appendable appendable, String separator)
void
appendString(Appendable appendable, String start, String separator, String end)
LazyLongIterable
asLazy()
MutableObjectLongMap<K>
asSynchronized()
MutableObjectLongMap<K>
asUnmodifiable()
double
average()
RichIterable<LongIterable>
chunk(int size)
void
clear()
<V> MutableCollection<V>
collect(LongToObjectFunction<? extends V> function)
void
compact()
Deprecated.since 12.0 - UsetrimToSize()
insteadboolean
contains(long value)
boolean
containsAll(long... source)
boolean
containsAll(LongIterable source)
boolean
containsKey(Object key)
boolean
containsValue(long value)
int
count(LongPredicate predicate)
long
detectIfNone(LongPredicate predicate, long ifNone)
void
each(LongProcedure procedure)
boolean
equals(Object obj)
MutableLongObjectMap<K>
flipUniqueValues()
void
forEachKey(Procedure<? super K> procedure)
void
forEachKeyValue(ObjectLongProcedure<? super K> procedure)
void
forEachValue(LongProcedure procedure)
long
get(Object key)
long
getAndPut(K key, long putValue, long defaultValue)
long
getIfAbsent(Object key, long ifAbsent)
long
getIfAbsentPut(K key, long value)
long
getIfAbsentPut(K key, LongFunction0 function)
<P> long
getIfAbsentPutWith(K key, LongFunction<? super P> function, P parameter)
long
getIfAbsentPutWithKey(K key, LongFunction<? super K> function)
long
getOrThrow(Object key)
int
hashCode()
<V> V
injectInto(V injectedValue, ObjectLongToObjectFunction<? super V,? extends V> function)
boolean
isEmpty()
Set<K>
keySet()
LazyIterable<K>
keysView()
RichIterable<ObjectLongPair<K>>
keyValuesView()
MutableLongIterator
longIterator()
String
makeString()
String
makeString(String separator)
String
makeString(String start, String separator, String end)
long
max()
long
maxIfEmpty(long defaultValue)
double
median()
long
min()
long
minIfEmpty(long defaultValue)
static <K> ObjectLongHashMap<K>
newMap()
static <K> ObjectLongHashMap<K>
newWithKeysValues(K key1, long value1)
static <K> ObjectLongHashMap<K>
newWithKeysValues(K key1, long value1, K key2, long value2)
static <K> ObjectLongHashMap<K>
newWithKeysValues(K key1, long value1, K key2, long value2, K key3, long value3)
static <K> ObjectLongHashMap<K>
newWithKeysValues(K key1, long value1, K key2, long value2, K key3, long value3, K key4, long value4)
boolean
noneSatisfy(LongPredicate predicate)
boolean
notEmpty()
void
put(K key, long value)
void
putAll(ObjectLongMap<? extends K> map)
void
readExternal(ObjectInput in)
MutableLongCollection
reject(LongPredicate predicate)
ObjectLongHashMap<K>
reject(ObjectLongPredicate<? super K> predicate)
void
remove(Object key)
void
removeKey(K key)
long
removeKeyIfAbsent(K key, long value)
MutableLongCollection
select(LongPredicate predicate)
ObjectLongHashMap<K>
select(ObjectLongPredicate<? super K> predicate)
int
size()
long
sum()
long[]
toArray()
long[]
toArray(long[] target)
MutableLongBag
toBag()
ImmutableObjectLongMap<K>
toImmutable()
MutableLongList
toList()
MutableLongSet
toSet()
long[]
toSortedArray()
MutableLongList
toSortedList()
String
toString()
boolean
trimToSize()
long
updateValue(K key, long initialValueIfAbsent, LongToLongFunction function)
void
updateValues(ObjectLongToLongFunction<? super K> function)
MutableLongCollection
values()
ObjectLongHashMap<K>
withKeysValues(K key1, long value1, K key2, long value2)
ObjectLongHashMap<K>
withKeysValues(K key1, long value1, K key2, long value2, K key3, long value3)
ObjectLongHashMap<K>
withKeysValues(K key1, long value1, K key2, long value2, K key3, long value3, K key4, long value4)
ObjectLongHashMap<K>
withKeyValue(K key1, long value1)
ObjectLongHashMap<K>
withoutAllKeys(Iterable<? extends K> keys)
ObjectLongHashMap<K>
withoutKey(K key)
void
writeExternal(ObjectOutput out)
-
Methods inherited from interface org.eclipse.collections.api.LongIterable
averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, medianIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.MutableObjectLongMap
putPair, tap, withAllKeyValues
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.ObjectLongMap
injectIntoKeyValue
-
-
-
-
Field Detail
-
EMPTY_VALUE
public static final long EMPTY_VALUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ObjectLongHashMap
public ObjectLongHashMap()
-
ObjectLongHashMap
public ObjectLongHashMap(int initialCapacity)
-
ObjectLongHashMap
public ObjectLongHashMap(ObjectLongMap<? extends K> map)
-
-
Method Detail
-
newMap
public static <K> ObjectLongHashMap<K> newMap()
-
newWithKeysValues
public static <K> ObjectLongHashMap<K> newWithKeysValues(K key1, long value1)
-
newWithKeysValues
public static <K> ObjectLongHashMap<K> newWithKeysValues(K key1, long value1, K key2, long value2)
-
newWithKeysValues
public static <K> ObjectLongHashMap<K> newWithKeysValues(K key1, long value1, K key2, long value2, K key3, long value3)
-
newWithKeysValues
public static <K> ObjectLongHashMap<K> newWithKeysValues(K key1, long value1, K key2, long value2, K key3, long value3, K key4, long value4)
-
toString
public String toString()
- Specified by:
toString
in interfaceObjectLongMap<K>
- Specified by:
toString
in interfacePrimitiveIterable
- Overrides:
toString
in classObject
-
size
public int size()
- Specified by:
size
in interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmpty
in interfacePrimitiveIterable
-
makeString
public String makeString()
- Specified by:
makeString
in interfacePrimitiveIterable
-
makeString
public String makeString(String separator)
- Specified by:
makeString
in interfacePrimitiveIterable
-
makeString
public String makeString(String start, String separator, String end)
- Specified by:
makeString
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable)
- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String separator)
- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendString
in interfacePrimitiveIterable
-
longIterator
public MutableLongIterator longIterator()
- Specified by:
longIterator
in interfaceLongIterable
- Specified by:
longIterator
in interfaceMutableObjectLongMap<K>
-
toArray
public long[] toArray()
- Specified by:
toArray
in interfaceLongIterable
-
toArray
public long[] toArray(long[] target)
- Specified by:
toArray
in interfaceLongIterable
-
contains
public boolean contains(long value)
- Specified by:
contains
in interfaceLongIterable
-
containsAll
public boolean containsAll(long... source)
- Specified by:
containsAll
in interfaceLongIterable
-
containsAll
public boolean containsAll(LongIterable source)
- Specified by:
containsAll
in interfaceLongIterable
-
clear
public void clear()
- Specified by:
clear
in interfaceMutableObjectLongMap<K>
-
put
public void put(K key, long value)
- Specified by:
put
in interfaceMutableObjectLongMap<K>
-
putAll
public void putAll(ObjectLongMap<? extends K> map)
- Specified by:
putAll
in interfaceMutableObjectLongMap<K>
-
updateValues
public void updateValues(ObjectLongToLongFunction<? super K> function)
- Specified by:
updateValues
in interfaceMutableObjectLongMap<K>
-
removeKey
public void removeKey(K key)
- Specified by:
removeKey
in interfaceMutableObjectLongMap<K>
-
remove
public void remove(Object key)
- Specified by:
remove
in interfaceMutableObjectLongMap<K>
-
removeKeyIfAbsent
public long removeKeyIfAbsent(K key, long value)
- Specified by:
removeKeyIfAbsent
in interfaceMutableObjectLongMap<K>
-
getIfAbsentPut
public long getIfAbsentPut(K key, long value)
- Specified by:
getIfAbsentPut
in interfaceMutableObjectLongMap<K>
-
getAndPut
public long getAndPut(K key, long putValue, long defaultValue)
- Specified by:
getAndPut
in interfaceMutableObjectLongMap<K>
-
getIfAbsentPut
public long getIfAbsentPut(K key, LongFunction0 function)
- Specified by:
getIfAbsentPut
in interfaceMutableObjectLongMap<K>
-
getIfAbsentPutWith
public <P> long getIfAbsentPutWith(K key, LongFunction<? super P> function, P parameter)
- Specified by:
getIfAbsentPutWith
in interfaceMutableObjectLongMap<K>
-
getIfAbsentPutWithKey
public long getIfAbsentPutWithKey(K key, LongFunction<? super K> function)
- Specified by:
getIfAbsentPutWithKey
in interfaceMutableObjectLongMap<K>
-
updateValue
public long updateValue(K key, long initialValueIfAbsent, LongToLongFunction function)
- Specified by:
updateValue
in interfaceMutableObjectLongMap<K>
-
addToValue
public long addToValue(K key, long toBeAdded)
- Specified by:
addToValue
in interfaceMutableObjectLongMap<K>
-
withKeyValue
public ObjectLongHashMap<K> withKeyValue(K key1, long value1)
- Specified by:
withKeyValue
in interfaceMutableObjectLongMap<K>
-
withKeysValues
public ObjectLongHashMap<K> withKeysValues(K key1, long value1, K key2, long value2)
-
withKeysValues
public ObjectLongHashMap<K> withKeysValues(K key1, long value1, K key2, long value2, K key3, long value3)
-
withKeysValues
public ObjectLongHashMap<K> withKeysValues(K key1, long value1, K key2, long value2, K key3, long value3, K key4, long value4)
-
withoutKey
public ObjectLongHashMap<K> withoutKey(K key)
- Specified by:
withoutKey
in interfaceMutableObjectLongMap<K>
-
withoutAllKeys
public ObjectLongHashMap<K> withoutAllKeys(Iterable<? extends K> keys)
- Specified by:
withoutAllKeys
in interfaceMutableObjectLongMap<K>
-
asUnmodifiable
public MutableObjectLongMap<K> asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableObjectLongMap<K>
-
asSynchronized
public MutableObjectLongMap<K> asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableObjectLongMap<K>
-
toImmutable
public ImmutableObjectLongMap<K> toImmutable()
- Specified by:
toImmutable
in interfaceObjectLongMap<K>
-
get
public long get(Object key)
- Specified by:
get
in interfaceObjectLongMap<K>
-
getOrThrow
public long getOrThrow(Object key)
- Specified by:
getOrThrow
in interfaceObjectLongMap<K>
-
getIfAbsent
public long getIfAbsent(Object key, long ifAbsent)
- Specified by:
getIfAbsent
in interfaceObjectLongMap<K>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceObjectLongMap<K>
-
containsValue
public boolean containsValue(long value)
- Specified by:
containsValue
in interfaceObjectLongMap<K>
-
each
public void each(LongProcedure procedure)
- Specified by:
each
in interfaceLongIterable
- Since:
- 7.0.
-
forEachValue
public void forEachValue(LongProcedure procedure)
- Specified by:
forEachValue
in interfaceObjectLongMap<K>
-
forEachKey
public void forEachKey(Procedure<? super K> procedure)
- Specified by:
forEachKey
in interfaceObjectLongMap<K>
-
forEachKeyValue
public void forEachKeyValue(ObjectLongProcedure<? super K> procedure)
- Specified by:
forEachKeyValue
in interfaceObjectLongMap<K>
-
select
public ObjectLongHashMap<K> select(ObjectLongPredicate<? super K> predicate)
- Specified by:
select
in interfaceMutableObjectLongMap<K>
- Specified by:
select
in interfaceObjectLongMap<K>
-
reject
public ObjectLongHashMap<K> reject(ObjectLongPredicate<? super K> predicate)
- Specified by:
reject
in interfaceMutableObjectLongMap<K>
- Specified by:
reject
in interfaceObjectLongMap<K>
-
select
public MutableLongCollection select(LongPredicate predicate)
- Specified by:
select
in interfaceLongIterable
- Specified by:
select
in interfaceMutableObjectLongMap<K>
-
reject
public MutableLongCollection reject(LongPredicate predicate)
- Specified by:
reject
in interfaceLongIterable
- Specified by:
reject
in interfaceMutableObjectLongMap<K>
-
detectIfNone
public long detectIfNone(LongPredicate predicate, long ifNone)
- Specified by:
detectIfNone
in interfaceLongIterable
-
collect
public <V> MutableCollection<V> collect(LongToObjectFunction<? extends V> function)
- Specified by:
collect
in interfaceLongIterable
- Specified by:
collect
in interfaceMutableObjectLongMap<K>
-
count
public int count(LongPredicate predicate)
- Specified by:
count
in interfaceLongIterable
-
anySatisfy
public boolean anySatisfy(LongPredicate predicate)
- Specified by:
anySatisfy
in interfaceLongIterable
-
allSatisfy
public boolean allSatisfy(LongPredicate predicate)
- Specified by:
allSatisfy
in interfaceLongIterable
-
noneSatisfy
public boolean noneSatisfy(LongPredicate predicate)
- Specified by:
noneSatisfy
in interfaceLongIterable
-
injectInto
public <V> V injectInto(V injectedValue, ObjectLongToObjectFunction<? super V,? extends V> function)
- Specified by:
injectInto
in interfaceLongIterable
-
chunk
public RichIterable<LongIterable> chunk(int size)
- Specified by:
chunk
in interfaceLongIterable
-
sum
public long sum()
- Specified by:
sum
in interfaceLongIterable
-
max
public long max()
- Specified by:
max
in interfaceLongIterable
-
min
public long min()
- Specified by:
min
in interfaceLongIterable
-
maxIfEmpty
public long maxIfEmpty(long defaultValue)
- Specified by:
maxIfEmpty
in interfaceLongIterable
-
minIfEmpty
public long minIfEmpty(long defaultValue)
- Specified by:
minIfEmpty
in interfaceLongIterable
-
average
public double average()
- Specified by:
average
in interfaceLongIterable
-
median
public double median()
- Specified by:
median
in interfaceLongIterable
-
toList
public MutableLongList toList()
- Specified by:
toList
in interfaceLongIterable
-
toSet
public MutableLongSet toSet()
- Specified by:
toSet
in interfaceLongIterable
-
toBag
public MutableLongBag toBag()
- Specified by:
toBag
in interfaceLongIterable
-
asLazy
public LazyLongIterable asLazy()
- Specified by:
asLazy
in interfaceLongIterable
-
toSortedArray
public long[] toSortedArray()
- Specified by:
toSortedArray
in interfaceLongIterable
-
toSortedList
public MutableLongList toSortedList()
- Specified by:
toSortedList
in interfaceLongIterable
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
keysView
public LazyIterable<K> keysView()
- Specified by:
keysView
in interfaceObjectLongMap<K>
-
keyValuesView
public RichIterable<ObjectLongPair<K>> keyValuesView()
- Specified by:
keyValuesView
in interfaceObjectLongMap<K>
-
flipUniqueValues
public MutableLongObjectMap<K> flipUniqueValues()
- Specified by:
flipUniqueValues
in interfaceMutableObjectLongMap<K>
- Specified by:
flipUniqueValues
in interfaceObjectLongMap<K>
-
trimToSize
public boolean trimToSize()
- Since:
- 12.0
-
compact
@Deprecated public void compact()
Deprecated.since 12.0 - UsetrimToSize()
insteadRehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
-
keySet
public Set<K> keySet()
- Specified by:
keySet
in interfaceObjectLongMap<K>
-
values
public MutableLongCollection values()
- Specified by:
values
in interfaceObjectLongMap<K>
-
-