IntBag, MutableIntBag, MutableIntCollection, IntIterable, PrimitiveIterablepublic final 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 Form| Constructor | Description |
|---|---|
SynchronizedIntBag(MutableIntBag bag) |
|
SynchronizedIntBag(MutableIntBag bag,
java.lang.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(java.lang.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(). |
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.
|
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, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, intIterator, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, remove, removeAll, removeAll, retainAll, retainAll, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toStringallSatisfy, anySatisfy, average, averageIfEmpty, 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, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedListtapadd, addAll, addAll, clear, intIterator, remove, removeAll, removeAll, retainAll, retainAllappendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringpublic SynchronizedIntBag(MutableIntBag bag)
public SynchronizedIntBag(MutableIntBag bag, java.lang.Object newLock)
public SynchronizedIntBag with(int element)
with in interface MutableIntBagwith in interface MutableIntCollectionwith in class AbstractSynchronizedIntCollectionpublic SynchronizedIntBag without(int element)
without in interface MutableIntBagwithout in interface MutableIntCollectionwithout in class AbstractSynchronizedIntCollectionpublic SynchronizedIntBag withAll(IntIterable elements)
withAll in interface MutableIntBagwithAll in interface MutableIntCollectionwithAll in class AbstractSynchronizedIntCollectionpublic SynchronizedIntBag withoutAll(IntIterable elements)
withoutAll in interface MutableIntBagwithoutAll in interface MutableIntCollectionwithoutAll in class AbstractSynchronizedIntCollectionpublic void addOccurrences(int item,
int occurrences)
addOccurrences in interface MutableIntBagpublic boolean removeOccurrences(int item,
int occurrences)
removeOccurrences in interface MutableIntBagpublic int sizeDistinct()
IntBagsizeDistinct in interface IntBagpublic int occurrencesOf(int item)
IntBagoccurrencesOf in interface IntBagpublic void forEachWithOccurrences(IntIntProcedure procedure)
IntBagforEachWithOccurrences in interface IntBagpublic MutableIntBag select(IntPredicate predicate)
IntIterableselect in interface IntBagselect in interface IntIterableselect in interface MutableIntBagselect in interface MutableIntCollectionselect in class AbstractSynchronizedIntCollectionpublic MutableIntBag selectByOccurrences(IntPredicate predicate)
MutableIntBagselectByOccurrences in interface IntBagselectByOccurrences in interface MutableIntBagpublic MutableList<IntIntPair> topOccurrences(int count)
MutableIntBagcount 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 IntBagtopOccurrences in interface MutableIntBagpublic MutableList<IntIntPair> bottomOccurrences(int count)
MutableIntBagcount 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 IntBagbottomOccurrences in interface MutableIntBagpublic MutableIntBag reject(IntPredicate predicate)
IntIterablereject in interface IntBagreject in interface IntIterablereject in interface MutableIntBagreject in interface MutableIntCollectionreject in class AbstractSynchronizedIntCollectionpublic <V> MutableBag<V> collect(IntToObjectFunction<? extends V> function)
IntIterablecollect in interface IntBagcollect in interface IntIterablecollect in interface MutableIntBagcollect in interface MutableIntCollectioncollect in class AbstractSynchronizedIntCollectionpublic boolean equals(java.lang.Object otherBag)
IntBagBag.equals(Object).public int hashCode()
IntBagBag.hashCode().public LazyIntIterable asLazy()
IntIterableasLazy in interface IntIterableasLazy in class AbstractSynchronizedIntCollectionpublic MutableIntBag asUnmodifiable()
asUnmodifiable in interface MutableIntBagasUnmodifiable in interface MutableIntCollectionasUnmodifiable in class AbstractSynchronizedIntCollectionpublic MutableIntBag asSynchronized()
asSynchronized in interface MutableIntBagasSynchronized in interface MutableIntCollectionasSynchronized in class AbstractSynchronizedIntCollectionpublic ImmutableIntBag toImmutable()
MutableIntBagtoImmutable in interface IntBagtoImmutable in interface MutableIntBagtoImmutable in interface MutableIntCollectiontoImmutable in class AbstractSynchronizedIntCollectionCopyright © 2004–2017. All rights reserved.