Serializable, LongBag, MutableLongBag, MutableLongCollection, LongIterable, PrimitiveIterable@ThreadSafe public final class SynchronizedLongBag extends AbstractSynchronizedLongCollection implements MutableLongBag
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.
MutableLongBag.asSynchronized(),
MutableBag.asSynchronized(),
Serialized Form| Constructor | Description |
|---|---|
SynchronizedLongBag(MutableLongBag bag) |
|
SynchronizedLongBag(MutableLongBag bag,
Object newLock) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addOccurrences(long item,
int occurrences) |
|
LazyLongIterable |
asLazy() |
Returns a LazyLongIterable adapter wrapping the source LongIterable.
|
MutableLongBag |
asSynchronized() |
|
MutableLongBag |
asUnmodifiable() |
|
MutableList<LongIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
<V> MutableBag<V> |
collect(LongToObjectFunction<? 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(LongIntProcedure 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(long item) |
The occurrences of a distinct item in the bag.
|
MutableLongBag |
reject(LongPredicate predicate) |
Returns a new LongIterable with all of the elements in the LongIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(long item,
int occurrences) |
|
MutableLongBag |
select(LongPredicate predicate) |
Returns a new LongIterable with all of the elements in the LongIterable that
return true for the specified predicate.
|
MutableLongBag |
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.
|
ImmutableLongBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<LongIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
SynchronizedLongBag |
with(long element) |
|
SynchronizedLongBag |
withAll(LongIterable elements) |
|
SynchronizedLongBag |
without(long element) |
|
SynchronizedLongBag |
withoutAll(LongIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, isEmpty, longIterator, 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, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedListadd, addAll, addAll, clear, longIterator, remove, removeAll, removeAll, retainAll, retainAllappendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringpublic SynchronizedLongBag(MutableLongBag bag)
public SynchronizedLongBag(MutableLongBag bag, Object newLock)
public SynchronizedLongBag with(long element)
with in interface MutableLongBagwith in interface MutableLongCollectionwith in class AbstractSynchronizedLongCollectionpublic SynchronizedLongBag without(long element)
without in interface MutableLongBagwithout in interface MutableLongCollectionwithout in class AbstractSynchronizedLongCollectionpublic SynchronizedLongBag withAll(LongIterable elements)
withAll in interface MutableLongBagwithAll in interface MutableLongCollectionwithAll in class AbstractSynchronizedLongCollectionpublic SynchronizedLongBag withoutAll(LongIterable elements)
withoutAll in interface MutableLongBagwithoutAll in interface MutableLongCollectionwithoutAll in class AbstractSynchronizedLongCollectionpublic void addOccurrences(long item,
int occurrences)
addOccurrences in interface MutableLongBagpublic boolean removeOccurrences(long item,
int occurrences)
removeOccurrences in interface MutableLongBagpublic int sizeDistinct()
LongBagsizeDistinct in interface LongBagpublic int occurrencesOf(long item)
LongBagoccurrencesOf in interface LongBagpublic void forEachWithOccurrences(LongIntProcedure procedure)
LongBagforEachWithOccurrences in interface LongBagpublic MutableLongBag select(LongPredicate predicate)
LongIterableselect in interface LongBagselect in interface LongIterableselect in interface MutableLongBagselect in interface MutableLongCollectionselect in class AbstractSynchronizedLongCollectionpublic MutableLongBag selectByOccurrences(IntPredicate predicate)
MutableLongBagselectByOccurrences in interface LongBagselectByOccurrences in interface MutableLongBagpublic MutableList<LongIntPair> topOccurrences(int count)
MutableLongBagcount 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 LongBagtopOccurrences in interface MutableLongBagpublic MutableList<LongIntPair> bottomOccurrences(int count)
MutableLongBagcount 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 LongBagbottomOccurrences in interface MutableLongBagpublic MutableLongBag reject(LongPredicate predicate)
LongIterablereject in interface LongBagreject in interface LongIterablereject in interface MutableLongBagreject in interface MutableLongCollectionreject in class AbstractSynchronizedLongCollectionpublic <V> MutableBag<V> collect(LongToObjectFunction<? extends V> function)
LongIterablecollect in interface LongBagcollect in interface LongIterablecollect in interface MutableLongBagcollect in interface MutableLongCollectioncollect in class AbstractSynchronizedLongCollectionpublic boolean equals(Object otherBag)
LongBagBag.equals(Object).public int hashCode()
LongBagBag.hashCode().public LazyLongIterable asLazy()
LongIterableasLazy in interface LongIterableasLazy in class AbstractSynchronizedLongCollectionpublic MutableLongBag asUnmodifiable()
asUnmodifiable in interface MutableLongBagasUnmodifiable in interface MutableLongCollectionasUnmodifiable in class AbstractSynchronizedLongCollectionpublic MutableLongBag asSynchronized()
asSynchronized in interface MutableLongBagasSynchronized in interface MutableLongCollectionasSynchronized in class AbstractSynchronizedLongCollectionpublic ImmutableLongBag toImmutable()
MutableLongBagtoImmutable in interface LongBagtoImmutable in interface MutableLongBagtoImmutable in interface MutableLongCollectiontoImmutable in class AbstractSynchronizedLongCollectionCopyright © 2004–2017. All rights reserved.