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:
isEmpty
in interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmpty
in interfacePrimitiveIterable
-
size
public int size()
- Specified by:
size
in interfacePrimitiveIterable
-
sizeDistinct
public int sizeDistinct()
- Specified by:
sizeDistinct
in interfaceLongBag
-
clear
public void clear()
- Specified by:
clear
in interfaceMutableLongCollection
-
with
public LongHashBag with(long element)
- Specified by:
with
in interfaceMutableLongBag
- Specified by:
with
in 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:
withAll
in interfaceMutableLongBag
- Specified by:
withAll
in interfaceMutableLongCollection
-
without
public LongHashBag without(long element)
- Specified by:
without
in interfaceMutableLongBag
- Specified by:
without
in interfaceMutableLongCollection
-
withoutAll
public LongHashBag withoutAll(LongIterable iterable)
- Specified by:
withoutAll
in interfaceMutableLongBag
- Specified by:
withoutAll
in interfaceMutableLongCollection
-
contains
public boolean contains(long value)
- Specified by:
contains
in interfaceLongIterable
-
occurrencesOf
public int occurrencesOf(long item)
- Specified by:
occurrencesOf
in interfaceLongBag
-
forEachWithOccurrences
public void forEachWithOccurrences(LongIntProcedure procedure)
- Specified by:
forEachWithOccurrences
in interfaceLongBag
-
selectByOccurrences
public LongHashBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrences
in interfaceLongBag
- Specified by:
selectByOccurrences
in interfaceMutableLongBag
-
selectUnique
public MutableLongSet selectUnique()
- Specified by:
selectUnique
in interfaceLongBag
- Specified by:
selectUnique
in interfaceMutableLongBag
-
topOccurrences
public MutableList<LongIntPair> topOccurrences(int count)
- Specified by:
topOccurrences
in interfaceLongBag
- Specified by:
topOccurrences
in interfaceMutableLongBag
-
bottomOccurrences
public MutableList<LongIntPair> bottomOccurrences(int count)
- Specified by:
bottomOccurrences
in interfaceLongBag
- Specified by:
bottomOccurrences
in interfaceMutableLongBag
-
add
public boolean add(long item)
- Specified by:
add
in interfaceMutableLongCollection
-
remove
public boolean remove(long item)
- Specified by:
remove
in interfaceMutableLongCollection
-
removeIf
public boolean removeIf(LongPredicate predicate)
- Specified by:
removeIf
in interfaceMutableLongCollection
-
addAll
public boolean addAll(long... source)
- Specified by:
addAll
in interfaceMutableLongCollection
-
addAll
public boolean addAll(LongIterable source)
- Specified by:
addAll
in interfaceMutableLongCollection
-
removeAll
public boolean removeAll(long... source)
- Specified by:
removeAll
in interfaceMutableLongCollection
-
removeAll
public boolean removeAll(LongIterable source)
- Specified by:
removeAll
in interfaceMutableLongCollection
-
retainAll
public boolean retainAll(LongIterable source)
- Specified by:
retainAll
in interfaceMutableLongCollection
-
retainAll
public boolean retainAll(long... source)
- Specified by:
retainAll
in interfaceMutableLongCollection
-
addOccurrences
public void addOccurrences(long item, int occurrences)
- Specified by:
addOccurrences
in interfaceMutableLongBag
-
removeOccurrences
public boolean removeOccurrences(long item, int occurrences)
- Specified by:
removeOccurrences
in interfaceMutableLongBag
-
each
public void each(LongProcedure procedure)
- Specified by:
each
in interfaceLongIterable
- Since:
- 7.0.
-
select
public LongHashBag select(LongPredicate predicate)
- Specified by:
select
in interfaceLongBag
- Specified by:
select
in interfaceLongIterable
- Specified by:
select
in interfaceMutableLongBag
- Specified by:
select
in interfaceMutableLongCollection
-
reject
public LongHashBag reject(LongPredicate predicate)
- Specified by:
reject
in interfaceLongBag
- Specified by:
reject
in interfaceLongIterable
- Specified by:
reject
in interfaceMutableLongBag
- Specified by:
reject
in interfaceMutableLongCollection
-
injectInto
public <T> T injectInto(T injectedValue, ObjectLongToObjectFunction<? super T,? extends T> function)
- Specified by:
injectInto
in interfaceLongIterable
-
chunk
public RichIterable<LongIterable> chunk(int size)
- Specified by:
chunk
in 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:
appendString
in interfacePrimitiveIterable
-
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
-
detectIfNone
public long detectIfNone(LongPredicate predicate, long ifNone)
- Specified by:
detectIfNone
in interfaceLongIterable
-
collect
public <V> MutableBag<V> collect(LongToObjectFunction<? extends V> function)
- Specified by:
collect
in interfaceLongBag
- Specified by:
collect
in interfaceLongIterable
- Specified by:
collect
in interfaceMutableLongBag
- Specified by:
collect
in interfaceMutableLongCollection
-
max
public long max()
- Specified by:
max
in interfaceLongIterable
-
min
public long min()
- Specified by:
min
in interfaceLongIterable
-
sum
public long sum()
- Specified by:
sum
in interfaceLongIterable
-
toArray
public long[] toArray()
- Specified by:
toArray
in interfaceLongIterable
-
toArray
public long[] toArray(long[] array)
- Specified by:
toArray
in interfaceLongIterable
-
asUnmodifiable
public MutableLongBag asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableLongBag
- Specified by:
asUnmodifiable
in interfaceMutableLongCollection
-
asSynchronized
public MutableLongBag asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableLongBag
- Specified by:
asSynchronized
in interfaceMutableLongCollection
-
toImmutable
public ImmutableLongBag toImmutable()
- Specified by:
toImmutable
in interfaceLongBag
- Specified by:
toImmutable
in interfaceMutableLongBag
- Specified by:
toImmutable
in interfaceMutableLongCollection
-
newEmpty
public LongHashBag newEmpty()
Creates a new empty LongHashBag.- Specified by:
newEmpty
in interfaceMutableLongBag
- Specified by:
newEmpty
in interfaceMutableLongCollection
- Since:
- 9.2.
-
longIterator
public MutableLongIterator longIterator()
- Specified by:
longIterator
in interfaceLongIterable
- Specified by:
longIterator
in interfaceMutableLongCollection
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-
-