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

public Class SynchronizedIntBag

extends AbstractSynchronizedIntCollection
implements MutableIntBag
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.bag.primitive.MutableIntBag, org.eclipse.collections.api.bag.primitive.IntBag, org.eclipse.collections.api.IntIterable, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.api.collection.primitive.MutableIntCollection
Imports
java.util.Collection, .Collections, org.eclipse.collections.api.IntIterable, .LazyIntIterable, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.bag.primitive.ImmutableIntBag, .MutableIntBag, org.eclipse.collections.api.block.function.primitive.IntToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.IntPredicate, org.eclipse.collections.api.block.procedure.primitive.IntIntProcedure, org.eclipse.collections.api.iterator.IntIterator, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.tuple.primitive.IntIntPair, org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedIntCollection, org.eclipse.collections.impl.factory.primitive.IntBags, org.eclipse.collections.impl.lazy.primitive.LazyIntIterableAdapter, org.eclipse.collections.api.set.primitive.MutableIntSet

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

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

Since
3.1.
See Also
MutableIntBag#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 LazyIntIterable
public MutableIntBag
public MutableIntBag
public MutableList<IntIntPair>
bottomOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.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.IntBag.equals.

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

public void
forEachWithOccurrences(IntIntProcedure procedure)

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

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

private MutableIntBag
public int
public MutableIntBag
public int
occurrencesOf(int item)

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

The occurrences of a distinct item in the bag.

public MutableIntBag
public boolean
public MutableIntBag
public MutableIntBag
selectByOccurrences(IntPredicate predicate)

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

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

public MutableIntSet
selectUnique()

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

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

public int
sizeDistinct()

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

The size of the Bag when counting only distinct elements.

public ImmutableIntBag
public MutableList<IntIntPair>
topOccurrences(int count)

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

Returns the count most frequently occurring items.

public SynchronizedIntBag
public SynchronizedIntBag
public SynchronizedIntBag
public SynchronizedIntBag
Inherited from org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedIntCollection:
addaddAlladdAllallSatisfyanySatisfyappendStringappendStringappendStringaveragechunkclearcontainscontainsAllcontainsAllcontainsAnycontainsAnycontainsNonecontainsNonecountdetectIfNoneeachgetIntCollectiongetLockinjectIntointIteratorisEmptymakeStringmakeStringmakeStringmaxmaxIfEmptymedianminminIfEmptynoneSatisfynotEmptyreducereduceIfEmptyremoveremoveAllremoveAllremoveIfretainAllretainAllsizesumtoArraytoArraytoBagtoListtoSettoSortedArraytoSortedListtoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

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

Constructor Detail

SynchronizedIntBagback to summary
public SynchronizedIntBag(MutableIntBag bag)
SynchronizedIntBagback to summary
public SynchronizedIntBag(MutableIntBag bag, Object newLock)

Method Detail

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

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

Annotations
@Override
asLazyback to summary
public LazyIntIterable asLazy()

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

Implements org.eclipse.collections.api.IntIterable.asLazy.

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

Returns a LazyIntIterable adapter wrapping the source IntIterable.

Annotations
@Override
asSynchronizedback to summary
public MutableIntBag asSynchronized()

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.asSynchronized, org.eclipse.collections.api.collection.primitive.MutableIntCollection.asSynchronized.

Annotations
@Override
asUnmodifiableback to summary
public MutableIntBag asUnmodifiable()

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.asUnmodifiable, org.eclipse.collections.api.collection.primitive.MutableIntCollection.asUnmodifiable.

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

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

Doc from org.eclipse.collections.api.bag.primitive.MutableIntBag.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(IntToObjectFunction<? extends V> function)

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.collect, org.eclipse.collections.api.collection.primitive.MutableIntCollection.collect.

Doc from org.eclipse.collections.api.IntIterable.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.IntBag.equals.

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

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

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

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

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

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

Annotations
@Override
getMutableIntBagback to summary
private MutableIntBag getMutableIntBag()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

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

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

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

Annotations
@Override
newEmptyback to summary
public MutableIntBag newEmpty()

Overrides default org.eclipse.collections.api.bag.primitive.MutableIntBag.newEmpty, org.eclipse.collections.api.collection.primitive.MutableIntCollection.newEmpty.

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

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

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

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

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

The occurrences of a distinct item in the bag.

Annotations
@Override
rejectback to summary
public MutableIntBag reject(IntPredicate predicate)

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.reject, org.eclipse.collections.api.collection.primitive.MutableIntCollection.reject.

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

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

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

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

Annotations
@Override
selectback to summary
public MutableIntBag select(IntPredicate predicate)

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.select, org.eclipse.collections.api.collection.primitive.MutableIntCollection.select.

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

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

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

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

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

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

Annotations
@Override
selectUniqueback to summary
public MutableIntSet selectUnique()

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

Doc from org.eclipse.collections.api.bag.primitive.MutableIntBag.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.IntBag.sizeDistinct.

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

The size of the Bag when counting only distinct elements.

Annotations
@Override
toImmutableback to summary
public ImmutableIntBag toImmutable()

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.toImmutable, org.eclipse.collections.api.collection.primitive.MutableIntCollection.toImmutable.

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

Returns an immutable copy of this bag.

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

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

Doc from org.eclipse.collections.api.bag.primitive.MutableIntBag.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 SynchronizedIntBag with(int element)

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.with, org.eclipse.collections.api.collection.primitive.MutableIntCollection.with.

Annotations
@Override
withAllback to summary
public SynchronizedIntBag withAll(IntIterable elements)

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.withAll, org.eclipse.collections.api.collection.primitive.MutableIntCollection.withAll.

Annotations
@Override
withoutback to summary
public SynchronizedIntBag without(int element)

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.without, org.eclipse.collections.api.collection.primitive.MutableIntCollection.without.

Annotations
@Override
withoutAllback to summary
public SynchronizedIntBag withoutAll(IntIterable elements)

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

Implements org.eclipse.collections.api.bag.primitive.MutableIntBag.withoutAll, org.eclipse.collections.api.collection.primitive.MutableIntCollection.withoutAll.

Annotations
@Override