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
public class LongHashBag extends AbstractLongIterable implements MutableLongBag, Externalizable
LongHashBag is similar toHashBag, and is memory-optimized for long primitives. This file was automatically generated from template file primitiveHashBag.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LongHashBag()LongHashBag(int size)LongHashBag(long... elements)LongHashBag(LongIterable iterable)LongHashBag(LongHashBag bag)
-
Method Summary
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractLongIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.LongBag
toStringOfItemToCount
-
Methods 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, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableLongBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
-
-
-
Constructor Detail
-
LongHashBag
public LongHashBag()
-
LongHashBag
public LongHashBag(int size)
-
LongHashBag
public LongHashBag(LongIterable iterable)
-
LongHashBag
public LongHashBag(long... elements)
-
LongHashBag
public LongHashBag(LongHashBag bag)
-
-
Method Detail
-
newBag
public static LongHashBag newBag(int size)
-
newBagWith
public static LongHashBag newBagWith(long... source)
-
newBag
public static LongHashBag newBag(LongIterable source)
-
newBag
public static LongHashBag newBag(LongBag source)
-
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
public LongHashBag with(long element)
- Specified by:
within interfaceMutableLongBag- Specified by:
within interfaceMutableLongCollection
-
with
public LongHashBag with(long element1, long element2)
-
with
public LongHashBag with(long element1, long element2, long element3)
-
withAll
public LongHashBag withAll(LongIterable iterable)
- Specified by:
withAllin interfaceMutableLongBag- Specified by:
withAllin interfaceMutableLongCollection
-
without
public LongHashBag without(long element)
- Specified by:
withoutin interfaceMutableLongBag- Specified by:
withoutin interfaceMutableLongCollection
-
withoutAll
public LongHashBag withoutAll(LongIterable iterable)
- 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
public void forEachWithOccurrences(LongIntProcedure procedure)
- Specified by:
forEachWithOccurrencesin interfaceLongBag
-
selectByOccurrences
public LongHashBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrencesin interfaceLongBag- Specified by:
selectByOccurrencesin interfaceMutableLongBag
-
selectUnique
public MutableLongSet selectUnique()
- Specified by:
selectUniquein interfaceLongBag- Specified by:
selectUniquein interfaceMutableLongBag
-
topOccurrences
public MutableList<LongIntPair> topOccurrences(int count)
- Specified by:
topOccurrencesin interfaceLongBag- Specified by:
topOccurrencesin interfaceMutableLongBag
-
bottomOccurrences
public MutableList<LongIntPair> bottomOccurrences(int count)
- 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
public boolean removeIf(LongPredicate predicate)
- Specified by:
removeIfin interfaceMutableLongCollection
-
addAll
public boolean addAll(long... source)
- Specified by:
addAllin interfaceMutableLongCollection
-
addAll
public boolean addAll(LongIterable source)
- Specified by:
addAllin interfaceMutableLongCollection
-
removeAll
public boolean removeAll(long... source)
- Specified by:
removeAllin interfaceMutableLongCollection
-
removeAll
public boolean removeAll(LongIterable source)
- Specified by:
removeAllin interfaceMutableLongCollection
-
retainAll
public boolean retainAll(LongIterable source)
- 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
public void each(LongProcedure procedure)
- Specified by:
eachin interfaceLongIterable- Since:
- 7.0.
-
select
public LongHashBag select(LongPredicate predicate)
- Specified by:
selectin interfaceLongBag- Specified by:
selectin interfaceLongIterable- Specified by:
selectin interfaceMutableLongBag- Specified by:
selectin interfaceMutableLongCollection
-
reject
public LongHashBag reject(LongPredicate predicate)
- 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
public RichIterable<LongIterable> chunk(int size)
- Specified by:
chunkin interfaceLongIterable
-
equals
public boolean equals(Object otherBag)
-
hashCode
public int hashCode()
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
count
public int count(LongPredicate predicate)
- Specified by:
countin interfaceLongIterable
-
anySatisfy
public boolean anySatisfy(LongPredicate predicate)
- Specified by:
anySatisfyin interfaceLongIterable
-
allSatisfy
public boolean allSatisfy(LongPredicate predicate)
- Specified by:
allSatisfyin interfaceLongIterable
-
noneSatisfy
public boolean noneSatisfy(LongPredicate predicate)
- Specified by:
noneSatisfyin interfaceLongIterable
-
detectIfNone
public long detectIfNone(LongPredicate predicate, long ifNone)
- Specified by:
detectIfNonein interfaceLongIterable
-
collect
public <V> MutableBag<V> collect(LongToObjectFunction<? extends V> function)
- 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
public MutableLongBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableLongBag- Specified by:
asUnmodifiablein interfaceMutableLongCollection
-
asSynchronized
public MutableLongBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableLongBag- Specified by:
asSynchronizedin interfaceMutableLongCollection
-
toImmutable
public ImmutableLongBag toImmutable()
- Specified by:
toImmutablein interfaceLongBag- Specified by:
toImmutablein interfaceMutableLongBag- Specified by:
toImmutablein interfaceMutableLongCollection
-
newEmpty
public LongHashBag newEmpty()
Creates a new empty LongHashBag.- Specified by:
newEmptyin interfaceMutableLongBag- Specified by:
newEmptyin interfaceMutableLongCollection- Since:
- 9.2.
-
longIterator
public MutableLongIterator longIterator()
- Specified by:
longIteratorin interfaceLongIterable- Specified by:
longIteratorin interfaceMutableLongCollection
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
-