Class LongHashBag
java.lang.Object
org.eclipse.collections.impl.primitive.AbstractLongIterable
org.eclipse.collections.impl.bag.mutable.primitive.LongHashBag
- All Implemented Interfaces:
Externalizable,Serializable,LongBag,MutableLongBag,MutableLongCollection,LongIterable,PrimitiveIterable
LongHashBag is similar to
HashBag, and is memory-optimized for long primitives.
This file was automatically generated from template file primitiveHashBag.stg.- Since:
- 3.0.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLongHashBag(int size) LongHashBag(long... elements) LongHashBag(LongIterable iterable) LongHashBag(LongHashBag bag) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(long item) booleanaddAll(long... source) booleanaddAll(LongIterable source) voidaddOccurrences(long item, int occurrences) booleanallSatisfy(LongPredicate predicate) booleananySatisfy(LongPredicate predicate) voidappendString(Appendable appendable, String start, String separator, String end) bottomOccurrences(int count) chunk(int size) voidclear()<V> MutableBag<V>collect(LongToObjectFunction<? extends V> function) booleancontains(long value) intcount(LongPredicate predicate) longdetectIfNone(LongPredicate predicate, long ifNone) voideach(LongProcedure procedure) booleanvoidforEachWithOccurrences(LongIntProcedure procedure) inthashCode()<T> TinjectInto(T injectedValue, ObjectLongToObjectFunction<? super T, ? extends T> function) booleanisEmpty()longmax()longmin()static LongHashBagnewBag(int size) static LongHashBagstatic LongHashBagnewBag(LongIterable source) static LongHashBagnewBagWith(long... source) newEmpty()Creates a new empty LongHashBag.booleannoneSatisfy(LongPredicate predicate) booleannotEmpty()intoccurrencesOf(long item) voidreject(LongPredicate predicate) booleanremove(long item) booleanremoveAll(long... source) booleanremoveAll(LongIterable source) booleanremoveIf(LongPredicate predicate) booleanremoveOccurrences(long item, int occurrences) booleanretainAll(long... source) booleanretainAll(LongIterable source) select(LongPredicate predicate) selectByOccurrences(IntPredicate predicate) intsize()intlongsum()long[]toArray()long[]toArray(long[] array) topOccurrences(int count) with(long element) with(long element1, long element2) with(long element1, long element2, long element3) withAll(LongIterable iterable) without(long element) withoutAll(LongIterable iterable) voidMethods inherited from class org.eclipse.collections.impl.primitive.AbstractLongIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringMethods inherited from interface org.eclipse.collections.api.bag.primitive.LongBag
toStringOfItemToCountMethods inherited from interface org.eclipse.collections.api.LongIterable
asLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListByMethods inherited from interface org.eclipse.collections.api.bag.primitive.MutableLongBag
selectDuplicates, tapMethods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
Constructor Details
-
LongHashBag
public LongHashBag() -
LongHashBag
public LongHashBag(int size) -
LongHashBag
-
LongHashBag
public LongHashBag(long... elements) -
LongHashBag
-
-
Method Details
-
newBag
-
newBagWith
-
newBag
-
newBag
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()- Specified by:
notEmptyin interfacePrimitiveIterable
-
size
public int size()- Specified by:
sizein interfacePrimitiveIterable
-
sizeDistinct
public int sizeDistinct()- Specified by:
sizeDistinctin interfaceLongBag
-
clear
public void clear()- Specified by:
clearin interfaceMutableLongCollection
-
with
- Specified by:
within interfaceMutableLongBag- Specified by:
within interfaceMutableLongCollection
-
with
-
with
-
withAll
- Specified by:
withAllin interfaceMutableLongBag- Specified by:
withAllin interfaceMutableLongCollection
-
without
- Specified by:
withoutin interfaceMutableLongBag- Specified by:
withoutin interfaceMutableLongCollection
-
withoutAll
- Specified by:
withoutAllin interfaceMutableLongBag- Specified by:
withoutAllin interfaceMutableLongCollection
-
contains
public boolean contains(long value) - Specified by:
containsin interfaceLongIterable
-
occurrencesOf
public int occurrencesOf(long item) - Specified by:
occurrencesOfin interfaceLongBag
-
forEachWithOccurrences
- Specified by:
forEachWithOccurrencesin interfaceLongBag
-
selectByOccurrences
- Specified by:
selectByOccurrencesin interfaceLongBag- Specified by:
selectByOccurrencesin interfaceMutableLongBag
-
selectUnique
- Specified by:
selectUniquein interfaceLongBag- Specified by:
selectUniquein interfaceMutableLongBag
-
topOccurrences
- Specified by:
topOccurrencesin interfaceLongBag- Specified by:
topOccurrencesin interfaceMutableLongBag
-
bottomOccurrences
- Specified by:
bottomOccurrencesin interfaceLongBag- Specified by:
bottomOccurrencesin interfaceMutableLongBag
-
add
public boolean add(long item) - Specified by:
addin interfaceMutableLongCollection
-
remove
public boolean remove(long item) - Specified by:
removein interfaceMutableLongCollection
-
removeIf
- Specified by:
removeIfin interfaceMutableLongCollection
-
addAll
public boolean addAll(long... source) - Specified by:
addAllin interfaceMutableLongCollection
-
addAll
- Specified by:
addAllin interfaceMutableLongCollection
-
removeAll
public boolean removeAll(long... source) - Specified by:
removeAllin interfaceMutableLongCollection
-
removeAll
- Specified by:
removeAllin interfaceMutableLongCollection
-
retainAll
- Specified by:
retainAllin interfaceMutableLongCollection
-
retainAll
public boolean retainAll(long... source) - Specified by:
retainAllin interfaceMutableLongCollection
-
addOccurrences
public void addOccurrences(long item, int occurrences) - Specified by:
addOccurrencesin interfaceMutableLongBag
-
removeOccurrences
public boolean removeOccurrences(long item, int occurrences) - Specified by:
removeOccurrencesin interfaceMutableLongBag
-
each
- Specified by:
eachin interfaceLongIterable- Since:
- 7.0.
-
select
- Specified by:
selectin interfaceLongBag- Specified by:
selectin interfaceLongIterable- Specified by:
selectin interfaceMutableLongBag- Specified by:
selectin interfaceMutableLongCollection
-
reject
- Specified by:
rejectin interfaceLongBag- Specified by:
rejectin interfaceLongIterable- Specified by:
rejectin interfaceMutableLongBag- Specified by:
rejectin interfaceMutableLongCollection
-
injectInto
public <T> T injectInto(T injectedValue, ObjectLongToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoin interfaceLongIterable
-
chunk
- Specified by:
chunkin interfaceLongIterable
-
equals
-
hashCode
public int hashCode() -
appendString
- Specified by:
appendStringin interfacePrimitiveIterable
-
count
- Specified by:
countin interfaceLongIterable
-
anySatisfy
- Specified by:
anySatisfyin interfaceLongIterable
-
allSatisfy
- Specified by:
allSatisfyin interfaceLongIterable
-
noneSatisfy
- Specified by:
noneSatisfyin interfaceLongIterable
-
detectIfNone
- Specified by:
detectIfNonein interfaceLongIterable
-
collect
- Specified by:
collectin interfaceLongBag- Specified by:
collectin interfaceLongIterable- Specified by:
collectin interfaceMutableLongBag- Specified by:
collectin interfaceMutableLongCollection
-
max
public long max()- Specified by:
maxin interfaceLongIterable
-
min
public long min()- Specified by:
minin interfaceLongIterable
-
sum
public long sum()- Specified by:
sumin interfaceLongIterable
-
toArray
public long[] toArray()- Specified by:
toArrayin interfaceLongIterable
-
toArray
public long[] toArray(long[] array) - Specified by:
toArrayin interfaceLongIterable
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableLongBag- Specified by:
asUnmodifiablein interfaceMutableLongCollection
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableLongBag- Specified by:
asSynchronizedin interfaceMutableLongCollection
-
toImmutable
- Specified by:
toImmutablein interfaceLongBag- Specified by:
toImmutablein interfaceMutableLongBag- Specified by:
toImmutablein interfaceMutableLongCollection
-
newEmpty
Creates a new empty LongHashBag.- Specified by:
newEmptyin interfaceMutableLongBag- Specified by:
newEmptyin interfaceMutableLongCollection- Since:
- 9.2.
-
longIterator
- Specified by:
longIteratorin interfaceLongIterable- Specified by:
longIteratorin interfaceMutableLongCollection
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-