Top Description Fields Constructors Methods
org.eclipse.collections.impl.bag.mutable.primitive

public Class SynchronizedLongBag

extends AbstractSynchronizedLongCollection
implements MutableLongBag
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.bag.primitive.MutableLongBag, org.eclipse.collections.api.bag.primitive.LongBag, org.eclipse.collections.api.LongIterable, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.api.collection.primitive.MutableLongCollection
Imports
java.util.Collection, .Collections, org.eclipse.collections.api.LongIterable, .LazyLongIterable, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.bag.primitive.ImmutableLongBag, .MutableLongBag, org.eclipse.collections.api.block.function.primitive.LongToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.IntPredicate, .LongPredicate, org.eclipse.collections.api.block.procedure.primitive.LongIntProcedure, org.eclipse.collections.api.iterator.LongIterator, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.tuple.primitive.LongIntPair, org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection, org.eclipse.collections.impl.factory.primitive.LongBags, org.eclipse.collections.impl.lazy.primitive.LazyLongIterableAdapter, org.eclipse.collections.api.set.primitive.MutableLongSet

A synchronized view of a MutableLongBag. It is imperative that the user manually synchronize on the collection when iterating over it using the LongIterator, as per Collections#synchronizedCollection(Collection).

This file was automatically generated from template file synchronizedPrimitiveBag.stg.

Since
3.1.
See Also
MutableLongBag#asSynchronized(), MutableBag#asSynchronized()

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
public LazyLongIterable
public MutableLongBag
public MutableLongBag
public MutableList<LongIntPair>
bottomOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.bottomOccurrences.

Returns the count least frequently occurring items.

public <V> MutableBag<V>
public boolean
equals(Object otherBag)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.bag.primitive.LongBag.equals.

Follows the same general contract as Bag#equals(Object).

public void
forEachWithOccurrences(LongIntProcedure procedure)

Implements org.eclipse.collections.api.bag.primitive.LongBag.forEachWithOccurrences.

For each distinct item, with the number of occurrences, execute the specified procedure.

private MutableLongBag
public int
public MutableLongBag
public int
occurrencesOf(long item)

Implements org.eclipse.collections.api.bag.primitive.LongBag.occurrencesOf.

The occurrences of a distinct item in the bag.

public MutableLongBag
public boolean
public MutableLongBag
public MutableLongBag
selectByOccurrences(IntPredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.selectByOccurrences.

Returns all elements of the bag that have a number of occurrences that satisfy the predicate.

public MutableLongSet
selectUnique()

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.selectUnique.

Returns all elements of the bag that have exactly one occurrence.

public int
sizeDistinct()

Implements org.eclipse.collections.api.bag.primitive.LongBag.sizeDistinct.

The size of the Bag when counting only distinct elements.

public ImmutableLongBag
public MutableList<LongIntPair>
topOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.topOccurrences.

Returns the count most frequently occurring items.

public SynchronizedLongBag
public SynchronizedLongBag
public SynchronizedLongBag
public SynchronizedLongBag
Inherited from org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection:
addaddAlladdAllallSatisfyanySatisfyappendStringappendStringappendStringaveragechunkclearcontainscontainsAllcontainsAllcontainsAnycontainsAnycontainsNonecontainsNonecountdetectIfNoneeachgetLockgetLongCollectioninjectIntoisEmptylongIteratormakeStringmakeStringmakeStringmaxmaxIfEmptymedianminminIfEmptynoneSatisfynotEmptyreducereduceIfEmptyremoveremoveAllremoveAllremoveIfretainAllretainAllsizesumtoArraytoArraytoBagtoListtoSettoSortedArraytoSortedListtoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.serialVersionUID.

Constructor Detail

SynchronizedLongBagback to summary
public SynchronizedLongBag(MutableLongBag bag)
SynchronizedLongBagback to summary
public SynchronizedLongBag(MutableLongBag bag, Object newLock)

Method Detail

addOccurrencesback to summary
public void addOccurrences(long item, int occurrences)

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.addOccurrences.

Annotations
@Override
asLazyback to summary
public LazyLongIterable asLazy()

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.asLazy.

Implements org.eclipse.collections.api.LongIterable.asLazy.

Doc from org.eclipse.collections.api.LongIterable.asLazy.

Returns a LazyLongIterable adapter wrapping the source LongIterable.

Annotations
@Override
asSynchronizedback to summary
public MutableLongBag asSynchronized()

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.asSynchronized.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.asSynchronized, org.eclipse.collections.api.collection.primitive.MutableLongCollection.asSynchronized.

Annotations
@Override
asUnmodifiableback to summary
public MutableLongBag asUnmodifiable()

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.asUnmodifiable.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.asUnmodifiable, org.eclipse.collections.api.collection.primitive.MutableLongCollection.asUnmodifiable.

Annotations
@Override
bottomOccurrencesback to summary
public MutableList<LongIntPair> bottomOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.bottomOccurrences.

Doc from org.eclipse.collections.api.bag.primitive.MutableLongBag.bottomOccurrences.

Returns the count least frequently occurring items. In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last item will be returned.

Annotations
@Override
collectback to summary
public <V> MutableBag<V> collect(LongToObjectFunction<? extends V> function)

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.collect.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.collect, org.eclipse.collections.api.collection.primitive.MutableLongCollection.collect.

Doc from org.eclipse.collections.api.LongIterable.collect.

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.

Annotations
@Override
equalsback to summary
public boolean equals(Object otherBag)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.bag.primitive.LongBag.equals.

Doc from org.eclipse.collections.api.bag.primitive.LongBag.equals.

Follows the same general contract as Bag#equals(Object).

Annotations
@Override
forEachWithOccurrencesback to summary
public void forEachWithOccurrences(LongIntProcedure procedure)

Implements org.eclipse.collections.api.bag.primitive.LongBag.forEachWithOccurrences.

Doc from org.eclipse.collections.api.bag.primitive.LongBag.forEachWithOccurrences.

For each distinct item, with the number of occurrences, execute the specified procedure.

Annotations
@Override
getMutableLongBagback to summary
private MutableLongBag getMutableLongBag()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.eclipse.collections.api.bag.primitive.LongBag.hashCode.

Doc from org.eclipse.collections.api.bag.primitive.LongBag.hashCode.

Follows the same general contract as Bag#hashCode().

Annotations
@Override
newEmptyback to summary
public MutableLongBag newEmpty()

Overrides default org.eclipse.collections.api.bag.primitive.MutableLongBag.newEmpty, org.eclipse.collections.api.collection.primitive.MutableLongCollection.newEmpty.

Doc from org.eclipse.collections.api.bag.primitive.MutableLongBag.newEmpty.

Creates a new empty mutable version of the same Bag type.

Annotations
@Override
Since
9.2.
occurrencesOfback to summary
public int occurrencesOf(long item)

Implements org.eclipse.collections.api.bag.primitive.LongBag.occurrencesOf.

Doc from org.eclipse.collections.api.bag.primitive.LongBag.occurrencesOf.

The occurrences of a distinct item in the bag.

Annotations
@Override
rejectback to summary
public MutableLongBag reject(LongPredicate predicate)

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.reject.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.reject, org.eclipse.collections.api.collection.primitive.MutableLongCollection.reject.

Doc from org.eclipse.collections.api.LongIterable.reject.

Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.

Annotations
@Override
removeOccurrencesback to summary
public boolean removeOccurrences(long item, int occurrences)

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.removeOccurrences.

Annotations
@Override
selectback to summary
public MutableLongBag select(LongPredicate predicate)

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.select.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.select, org.eclipse.collections.api.collection.primitive.MutableLongCollection.select.

Doc from org.eclipse.collections.api.LongIterable.select.

Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.

Annotations
@Override
selectByOccurrencesback to summary
public MutableLongBag selectByOccurrences(IntPredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.selectByOccurrences.

Doc from org.eclipse.collections.api.bag.primitive.MutableLongBag.selectByOccurrences.

Returns all elements of the bag that have a number of occurrences that satisfy the predicate.

Annotations
@Override
selectUniqueback to summary
public MutableLongSet selectUnique()

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.selectUnique.

Doc from org.eclipse.collections.api.bag.primitive.MutableLongBag.selectUnique.

Returns all elements of the bag that have exactly one occurrence.

Annotations
@Override
sizeDistinctback to summary
public int sizeDistinct()

Implements org.eclipse.collections.api.bag.primitive.LongBag.sizeDistinct.

Doc from org.eclipse.collections.api.bag.primitive.LongBag.sizeDistinct.

The size of the Bag when counting only distinct elements.

Annotations
@Override
toImmutableback to summary
public ImmutableLongBag toImmutable()

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.toImmutable.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.toImmutable, org.eclipse.collections.api.collection.primitive.MutableLongCollection.toImmutable.

Doc from org.eclipse.collections.api.bag.primitive.MutableLongBag.toImmutable.

Returns an immutable copy of this bag.

Annotations
@Override
topOccurrencesback to summary
public MutableList<LongIntPair> topOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.topOccurrences.

Doc from org.eclipse.collections.api.bag.primitive.MutableLongBag.topOccurrences.

Returns the count most frequently occurring items. In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last item will be returned.

Annotations
@Override
withback to summary
public SynchronizedLongBag with(long element)

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.with.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.with, org.eclipse.collections.api.collection.primitive.MutableLongCollection.with.

Annotations
@Override
withAllback to summary
public SynchronizedLongBag withAll(LongIterable elements)

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.withAll.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.withAll, org.eclipse.collections.api.collection.primitive.MutableLongCollection.withAll.

Annotations
@Override
withoutback to summary
public SynchronizedLongBag without(long element)

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.without.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.without, org.eclipse.collections.api.collection.primitive.MutableLongCollection.without.

Annotations
@Override
withoutAllback to summary
public SynchronizedLongBag withoutAll(LongIterable elements)

Overrides org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection.withoutAll.

Implements org.eclipse.collections.api.bag.primitive.MutableLongBag.withoutAll, org.eclipse.collections.api.collection.primitive.MutableLongCollection.withoutAll.

Annotations
@Override