Serializable
, MutableShortBag
, ShortBag
, MutableShortCollection
, PrimitiveIterable
, ShortIterable
public class SynchronizedShortBag extends AbstractSynchronizedShortCollection implements MutableShortBag
MutableShortBag
. It is imperative that the user manually synchronize on the collection when iterating over it using the
ShortIterator
, as per Collections.synchronizedCollection(Collection)
.
This file was automatically generated from template file synchronizedPrimitiveBag.stg.
MutableShortBag.asSynchronized()
,
MutableBag.asSynchronized()
,
Serialized FormConstructor | Description |
---|---|
SynchronizedShortBag(MutableShortBag bag) |
|
SynchronizedShortBag(MutableShortBag bag,
Object newLock) |
Modifier and Type | Method | Description |
---|---|---|
void |
addOccurrences(short item,
int occurrences) |
|
LazyShortIterable |
asLazy() |
Returns a LazyShortIterable adapter wrapping the source ShortIterable.
|
MutableShortBag |
asSynchronized() |
|
MutableShortBag |
asUnmodifiable() |
|
MutableList<ShortIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
<V> MutableBag<V> |
collect(ShortToObjectFunction<? 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(ShortIntProcedure procedure) |
For each distinct item, with the number of occurrences, execute the specified procedure.
|
int |
hashCode() |
Follows the same general contract as
Bag.hashCode() . |
MutableShortBag |
newEmpty() |
Creates a new empty mutable version of the same Bag type.
|
int |
occurrencesOf(short item) |
The occurrences of a distinct item in the bag.
|
MutableShortBag |
reject(ShortPredicate predicate) |
Returns a new ShortIterable with all of the elements in the ShortIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(short item,
int occurrences) |
|
MutableShortBag |
select(ShortPredicate predicate) |
Returns a new ShortIterable with all of the elements in the ShortIterable that
return true for the specified predicate.
|
MutableShortBag |
selectByOccurrences(IntPredicate predicate) |
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
MutableShortSet |
selectUnique() |
Returns all elements of the bag that have exactly one occurrence.
|
int |
sizeDistinct() |
The size of the Bag when counting only distinct elements.
|
ImmutableShortBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<ShortIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
SynchronizedShortBag |
with(short element) |
|
SynchronizedShortBag |
withAll(ShortIterable elements) |
|
SynchronizedShortBag |
without(short element) |
|
SynchronizedShortBag |
withoutAll(ShortIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIterator, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
selectDuplicates, tap
add, addAll, addAll, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIterator
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, 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
public SynchronizedShortBag(MutableShortBag bag)
public SynchronizedShortBag(MutableShortBag bag, Object newLock)
public SynchronizedShortBag with(short element)
with
in interface MutableShortBag
with
in interface MutableShortCollection
with
in class AbstractSynchronizedShortCollection
public SynchronizedShortBag without(short element)
without
in interface MutableShortBag
without
in interface MutableShortCollection
without
in class AbstractSynchronizedShortCollection
public SynchronizedShortBag withAll(ShortIterable elements)
withAll
in interface MutableShortBag
withAll
in interface MutableShortCollection
withAll
in class AbstractSynchronizedShortCollection
public SynchronizedShortBag withoutAll(ShortIterable elements)
withoutAll
in interface MutableShortBag
withoutAll
in interface MutableShortCollection
withoutAll
in class AbstractSynchronizedShortCollection
public void addOccurrences(short item, int occurrences)
addOccurrences
in interface MutableShortBag
public boolean removeOccurrences(short item, int occurrences)
removeOccurrences
in interface MutableShortBag
public int sizeDistinct()
ShortBag
sizeDistinct
in interface ShortBag
public int occurrencesOf(short item)
ShortBag
occurrencesOf
in interface ShortBag
public void forEachWithOccurrences(ShortIntProcedure procedure)
ShortBag
forEachWithOccurrences
in interface ShortBag
public MutableShortBag select(ShortPredicate predicate)
ShortIterable
select
in interface MutableShortBag
select
in interface MutableShortCollection
select
in interface ShortBag
select
in interface ShortIterable
select
in class AbstractSynchronizedShortCollection
public MutableShortBag selectByOccurrences(IntPredicate predicate)
MutableShortBag
selectByOccurrences
in interface MutableShortBag
selectByOccurrences
in interface ShortBag
public MutableShortSet selectUnique()
MutableShortBag
selectUnique
in interface MutableShortBag
selectUnique
in interface ShortBag
public MutableList<ShortIntPair> topOccurrences(int count)
MutableShortBag
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 MutableShortBag
topOccurrences
in interface ShortBag
public MutableList<ShortIntPair> bottomOccurrences(int count)
MutableShortBag
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 MutableShortBag
bottomOccurrences
in interface ShortBag
public MutableShortBag reject(ShortPredicate predicate)
ShortIterable
reject
in interface MutableShortBag
reject
in interface MutableShortCollection
reject
in interface ShortBag
reject
in interface ShortIterable
reject
in class AbstractSynchronizedShortCollection
public <V> MutableBag<V> collect(ShortToObjectFunction<? extends V> function)
ShortIterable
collect
in interface MutableShortBag
collect
in interface MutableShortCollection
collect
in interface ShortBag
collect
in interface ShortIterable
collect
in class AbstractSynchronizedShortCollection
public boolean equals(Object otherBag)
ShortBag
Bag.equals(Object)
.public int hashCode()
ShortBag
Bag.hashCode()
.public LazyShortIterable asLazy()
ShortIterable
asLazy
in interface ShortIterable
asLazy
in class AbstractSynchronizedShortCollection
public MutableShortBag asUnmodifiable()
asUnmodifiable
in interface MutableShortBag
asUnmodifiable
in interface MutableShortCollection
asUnmodifiable
in class AbstractSynchronizedShortCollection
public MutableShortBag asSynchronized()
asSynchronized
in interface MutableShortBag
asSynchronized
in interface MutableShortCollection
asSynchronized
in class AbstractSynchronizedShortCollection
public ImmutableShortBag toImmutable()
MutableShortBag
toImmutable
in interface MutableShortBag
toImmutable
in interface MutableShortCollection
toImmutable
in interface ShortBag
toImmutable
in class AbstractSynchronizedShortCollection
public MutableShortBag newEmpty()
MutableShortBag
newEmpty
in interface MutableShortBag
newEmpty
in interface MutableShortCollection
Copyright © 2004–2019. All rights reserved.