Class AbstractMutableLongValuesMap
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractLongIterable
-
- org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableLongValuesMap
-
- All Implemented Interfaces:
LongIterable
,LongValuesMap
,MutableLongValuesMap
,PrimitiveIterable
- Direct Known Subclasses:
ByteLongHashMap
,CharLongHashMap
,DoubleLongHashMap
,FloatLongHashMap
,IntLongHashMap
,LongLongHashMap
,ShortLongHashMap
public abstract class AbstractMutableLongValuesMap extends AbstractLongIterable implements MutableLongValuesMap
This file was automatically generated from template file abstractMutablePrimitiveValuesMap.stg.- Since:
- 6.0.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractMutableLongValuesMap.AbstractLongValuesCollection
protected static class
AbstractMutableLongValuesMap.SentinelValues
-
Constructor Summary
Constructors Constructor Description AbstractMutableLongValuesMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addEmptyKeyValue(long value)
protected void
addRemovedKeyValue(long value)
boolean
allSatisfy(LongPredicate predicate)
Returns true if all of the elements in the LongIterable return true for the specified predicate, otherwise returns false.boolean
anySatisfy(LongPredicate predicate)
Returns true if any of the elements in the LongIterable return true for the specified predicate, otherwise returns false.void
appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)
Prints a string representation of this collection onto the givenAppendable
.RichIterable<LongIterable>
chunk(int size)
Partitions elements in fixed size chunks.<V> MutableBag<V>
collect(LongToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection.boolean
contains(long value)
Returns true if the value is contained in the LongIterable, and false if it is not.boolean
containsAll(LongIterable source)
Returns true if all of the values specified in the source LongIterable are contained in the LongIterable, and false if they are not.boolean
containsValue(long value)
Returns whether or not this map contains the value.int
count(LongPredicate predicate)
Returns a count of the number of elements in the LongIterable that return true for the specified predicate.long
detectIfNone(LongPredicate predicate, long value)
void
each(LongProcedure procedure)
A synonym for forEach.void
forEachValue(LongProcedure procedure)
Iterates through each value in this map.protected abstract long
getEmptyValue()
protected abstract int
getOccupiedWithData()
protected abstract AbstractMutableLongValuesMap.SentinelValues
getSentinelValues()
protected abstract int
getTableSize()
protected abstract long
getValueAtIndex(int index)
boolean
isEmpty()
Returns true if this iterable has zero items.protected abstract boolean
isNonSentinelAtIndex(int index)
long
max()
long
min()
boolean
notEmpty()
The English equivalent of !this.isEmpty()MutableLongBag
reject(LongPredicate predicate)
Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.protected void
removeEmptyKey()
protected void
removeRemovedKey()
MutableLongBag
select(LongPredicate predicate)
Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.protected abstract void
setSentinelValuesNull()
int
size()
Returns the number of items in this iterable.long
sum()
long[]
toArray()
Converts the LongIterable to a primitive long array.long[]
toArray(long[] target)
Converts the LongIterable to a primitive long array.-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractLongIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.LongIterable
asLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.LongValuesMap
tap, values
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.MutableLongValuesMap
clear, longIterator
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
-
-
-
Method Detail
-
getOccupiedWithData
protected abstract int getOccupiedWithData()
-
getSentinelValues
protected abstract AbstractMutableLongValuesMap.SentinelValues getSentinelValues()
-
setSentinelValuesNull
protected abstract void setSentinelValuesNull()
-
getEmptyValue
protected abstract long getEmptyValue()
-
getValueAtIndex
protected abstract long getValueAtIndex(int index)
-
getTableSize
protected abstract int getTableSize()
-
isNonSentinelAtIndex
protected abstract boolean isNonSentinelAtIndex(int index)
-
addEmptyKeyValue
protected void addEmptyKeyValue(long value)
-
removeEmptyKey
protected void removeEmptyKey()
-
addRemovedKeyValue
protected void addRemovedKeyValue(long value)
-
removeRemovedKey
protected void removeRemovedKey()
-
contains
public boolean contains(long value)
Description copied from interface:LongIterable
Returns true if the value is contained in the LongIterable, and false if it is not.- Specified by:
contains
in interfaceLongIterable
-
containsAll
public boolean containsAll(LongIterable source)
Description copied from interface:LongIterable
Returns true if all of the values specified in the source LongIterable are contained in the LongIterable, and false if they are not.- Specified by:
containsAll
in interfaceLongIterable
-
max
public long max()
- Specified by:
max
in interfaceLongIterable
-
min
public long min()
- Specified by:
min
in interfaceLongIterable
-
size
public int size()
Description copied from interface:PrimitiveIterable
Returns the number of items in this iterable.- Specified by:
size
in interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()
Description copied from interface:PrimitiveIterable
Returns true if this iterable has zero items.- Specified by:
isEmpty
in interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
Description copied from interface:PrimitiveIterable
The English equivalent of !this.isEmpty()- Specified by:
notEmpty
in interfacePrimitiveIterable
-
each
public void each(LongProcedure procedure)
Description copied from interface:LongIterable
A synonym for forEach.- Specified by:
each
in interfaceLongIterable
- Since:
- 7.0.
-
appendString
public void appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString(String, String, String)
.- Specified by:
appendString
in interfacePrimitiveIterable
-
toArray
public long[] toArray()
Description copied from interface:LongIterable
Converts the LongIterable to a primitive long array.- Specified by:
toArray
in interfaceLongIterable
-
toArray
public long[] toArray(long[] target)
Description copied from interface:LongIterable
Converts the LongIterable to a primitive long array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.- Specified by:
toArray
in interfaceLongIterable
-
select
public MutableLongBag select(LongPredicate predicate)
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.- Specified by:
select
in interfaceLongIterable
- Specified by:
select
in interfaceLongValuesMap
- Specified by:
select
in interfaceMutableLongValuesMap
-
reject
public MutableLongBag reject(LongPredicate predicate)
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.- Specified by:
reject
in interfaceLongIterable
- Specified by:
reject
in interfaceLongValuesMap
- Specified by:
reject
in interfaceMutableLongValuesMap
-
collect
public <V> MutableBag<V> collect(LongToObjectFunction<? extends V> function)
Description copied from interface:LongIterable
Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collect
in interfaceLongIterable
- Specified by:
collect
in interfaceLongValuesMap
- Specified by:
collect
in interfaceMutableLongValuesMap
-
detectIfNone
public long detectIfNone(LongPredicate predicate, long value)
- Specified by:
detectIfNone
in interfaceLongIterable
-
count
public int count(LongPredicate predicate)
Description copied from interface:LongIterable
Returns a count of the number of elements in the LongIterable that return true for the specified predicate.- Specified by:
count
in interfaceLongIterable
-
anySatisfy
public boolean anySatisfy(LongPredicate predicate)
Description copied from interface:LongIterable
Returns true if any of the elements in the LongIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfy
in interfaceLongIterable
-
allSatisfy
public boolean allSatisfy(LongPredicate predicate)
Description copied from interface:LongIterable
Returns true if all of the elements in the LongIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfy
in interfaceLongIterable
-
chunk
public RichIterable<LongIterable> chunk(int size)
Description copied from interface:LongIterable
Partitions elements in fixed size chunks.- Specified by:
chunk
in interfaceLongIterable
- Parameters:
size
- the number of elements per chunk- Returns:
- A
RichIterable
containingLongIterable
s of sizesize
, except the last will be truncated if the elements don't divide evenly.
-
sum
public long sum()
- Specified by:
sum
in interfaceLongIterable
-
containsValue
public boolean containsValue(long value)
Description copied from interface:LongValuesMap
Returns whether or not this map contains the value.- Specified by:
containsValue
in interfaceLongValuesMap
- Parameters:
value
- the value to test- Returns:
- if this collection contains the value
-
forEachValue
public void forEachValue(LongProcedure procedure)
Description copied from interface:LongValuesMap
Iterates through each value in this map.- Specified by:
forEachValue
in interfaceLongValuesMap
- Parameters:
procedure
- the procedure to invoke for each value in this map.
-
-