Serializable
, IntBag
, MutableIntBag
, MutableIntCollection
, IntIterable
, PrimitiveIterable
public class SynchronizedIntBag extends AbstractSynchronizedIntCollection implements MutableIntBag
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.
MutableIntBag.asSynchronized()
,
MutableBag.asSynchronized()
,
Serialized FormConstructor | Description |
---|---|
SynchronizedIntBag(MutableIntBag bag) |
|
SynchronizedIntBag(MutableIntBag bag,
Object newLock) |
Modifier and Type | Method | Description |
---|---|---|
void |
addOccurrences(int item,
int occurrences) |
|
LazyIntIterable |
asLazy() |
Returns a LazyIntIterable adapter wrapping the source IntIterable.
|
MutableIntBag |
asSynchronized() |
|
MutableIntBag |
asUnmodifiable() |
|
MutableList<IntIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
<V> MutableBag<V> |
collect(IntToObjectFunction<? extends V> function) |
Returns a new collection with the results of applying the specified function on each element of the source
collection.
|
boolean |
equals(Object otherBag) |
Follows the same general contract as
Bag.equals(Object) . |
void |
forEachWithOccurrences(IntIntProcedure procedure) |
For each distinct item, with the number of occurrences, execute the specified procedure.
|
int |
hashCode() |
Follows the same general contract as
Bag.hashCode() . |
MutableIntBag |
newEmpty() |
Creates a new empty mutable version of the same Bag type.
|
int |
occurrencesOf(int item) |
The occurrences of a distinct item in the bag.
|
MutableIntBag |
reject(IntPredicate predicate) |
Returns a new IntIterable with all of the elements in the IntIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(int item,
int occurrences) |
|
MutableIntBag |
select(IntPredicate predicate) |
Returns a new IntIterable with all of the elements in the IntIterable that
return true for the specified predicate.
|
MutableIntBag |
selectByOccurrences(IntPredicate predicate) |
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
MutableIntSet |
selectUnique() |
Returns all elements of the bag that have exactly one occurrence.
|
int |
sizeDistinct() |
The size of the Bag when counting only distinct elements.
|
ImmutableIntBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<IntIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
SynchronizedIntBag |
with(int element) |
|
SynchronizedIntBag |
withAll(IntIterable elements) |
|
SynchronizedIntBag |
without(int element) |
|
SynchronizedIntBag |
withoutAll(IntIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, intIterator, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
toStringOfItemToCount
allSatisfy, anySatisfy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedList
selectDuplicates, tap
add, addAll, addAll, clear, intIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
public SynchronizedIntBag(MutableIntBag bag)
public SynchronizedIntBag(MutableIntBag bag, Object newLock)
public SynchronizedIntBag with(int element)
with
in interface MutableIntBag
with
in interface MutableIntCollection
with
in class AbstractSynchronizedIntCollection
public SynchronizedIntBag without(int element)
without
in interface MutableIntBag
without
in interface MutableIntCollection
without
in class AbstractSynchronizedIntCollection
public SynchronizedIntBag withAll(IntIterable elements)
withAll
in interface MutableIntBag
withAll
in interface MutableIntCollection
withAll
in class AbstractSynchronizedIntCollection
public SynchronizedIntBag withoutAll(IntIterable elements)
withoutAll
in interface MutableIntBag
withoutAll
in interface MutableIntCollection
withoutAll
in class AbstractSynchronizedIntCollection
public void addOccurrences(int item, int occurrences)
addOccurrences
in interface MutableIntBag
public boolean removeOccurrences(int item, int occurrences)
removeOccurrences
in interface MutableIntBag
public int sizeDistinct()
IntBag
sizeDistinct
in interface IntBag
public int occurrencesOf(int item)
IntBag
occurrencesOf
in interface IntBag
public void forEachWithOccurrences(IntIntProcedure procedure)
IntBag
forEachWithOccurrences
in interface IntBag
public MutableIntBag select(IntPredicate predicate)
IntIterable
select
in interface IntBag
select
in interface IntIterable
select
in interface MutableIntBag
select
in interface MutableIntCollection
select
in class AbstractSynchronizedIntCollection
public MutableIntBag selectByOccurrences(IntPredicate predicate)
MutableIntBag
selectByOccurrences
in interface IntBag
selectByOccurrences
in interface MutableIntBag
public MutableIntSet selectUnique()
MutableIntBag
selectUnique
in interface IntBag
selectUnique
in interface MutableIntBag
public MutableList<IntIntPair> topOccurrences(int count)
MutableIntBag
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.topOccurrences
in interface IntBag
topOccurrences
in interface MutableIntBag
public MutableList<IntIntPair> bottomOccurrences(int count)
MutableIntBag
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.bottomOccurrences
in interface IntBag
bottomOccurrences
in interface MutableIntBag
public MutableIntBag reject(IntPredicate predicate)
IntIterable
reject
in interface IntBag
reject
in interface IntIterable
reject
in interface MutableIntBag
reject
in interface MutableIntCollection
reject
in class AbstractSynchronizedIntCollection
public <V> MutableBag<V> collect(IntToObjectFunction<? extends V> function)
IntIterable
collect
in interface IntBag
collect
in interface IntIterable
collect
in interface MutableIntBag
collect
in interface MutableIntCollection
collect
in class AbstractSynchronizedIntCollection
public boolean equals(Object otherBag)
IntBag
Bag.equals(Object)
.public int hashCode()
IntBag
Bag.hashCode()
.public LazyIntIterable asLazy()
IntIterable
asLazy
in interface IntIterable
asLazy
in class AbstractSynchronizedIntCollection
public MutableIntBag asUnmodifiable()
asUnmodifiable
in interface MutableIntBag
asUnmodifiable
in interface MutableIntCollection
asUnmodifiable
in class AbstractSynchronizedIntCollection
public MutableIntBag asSynchronized()
asSynchronized
in interface MutableIntBag
asSynchronized
in interface MutableIntCollection
asSynchronized
in class AbstractSynchronizedIntCollection
public ImmutableIntBag toImmutable()
MutableIntBag
toImmutable
in interface IntBag
toImmutable
in interface MutableIntBag
toImmutable
in interface MutableIntCollection
toImmutable
in class AbstractSynchronizedIntCollection
public MutableIntBag newEmpty()
MutableIntBag
newEmpty
in interface MutableIntBag
newEmpty
in interface MutableIntCollection
Copyright © 2004–2019. All rights reserved.