Serializable
, DoubleBag
, MutableDoubleBag
, MutableDoubleCollection
, DoubleIterable
, PrimitiveIterable
@ThreadSafe public final class SynchronizedDoubleBag extends AbstractSynchronizedDoubleCollection implements MutableDoubleBag
MutableDoubleBag
. It is imperative that the user manually synchronize on the collection when iterating over it using the
DoubleIterator
, as per Collections.synchronizedCollection(Collection)
.
This file was automatically generated from template file synchronizedPrimitiveBag.stg.
MutableDoubleBag.asSynchronized()
,
MutableBag.asSynchronized()
,
Serialized FormConstructor | Description |
---|---|
SynchronizedDoubleBag(MutableDoubleBag bag) |
|
SynchronizedDoubleBag(MutableDoubleBag bag,
Object newLock) |
Modifier and Type | Method | Description |
---|---|---|
void |
addOccurrences(double item,
int occurrences) |
|
LazyDoubleIterable |
asLazy() |
Returns a LazyDoubleIterable adapter wrapping the source DoubleIterable.
|
MutableDoubleBag |
asSynchronized() |
|
MutableDoubleBag |
asUnmodifiable() |
|
MutableList<DoubleIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
<V> MutableBag<V> |
collect(DoubleToObjectFunction<? 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(DoubleIntProcedure 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(double item) |
The occurrences of a distinct item in the bag.
|
MutableDoubleBag |
reject(DoublePredicate predicate) |
Returns a new DoubleIterable with all of the elements in the DoubleIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(double item,
int occurrences) |
|
MutableDoubleBag |
select(DoublePredicate predicate) |
Returns a new DoubleIterable with all of the elements in the DoubleIterable that
return true for the specified predicate.
|
MutableDoubleBag |
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.
|
ImmutableDoubleBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<DoubleIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
SynchronizedDoubleBag |
with(double element) |
|
SynchronizedDoubleBag |
withAll(DoubleIterable elements) |
|
SynchronizedDoubleBag |
without(double element) |
|
SynchronizedDoubleBag |
withoutAll(DoubleIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, clear, contains, containsAll, containsAll, count, detectIfNone, doubleIterator, each, forEach, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, remove, removeAll, removeAll, retainAll, retainAll, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
allSatisfy, 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, toSortedList
add, addAll, addAll, clear, doubleIterator, remove, removeAll, removeAll, retainAll, retainAll
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
public SynchronizedDoubleBag(MutableDoubleBag bag)
public SynchronizedDoubleBag(MutableDoubleBag bag, Object newLock)
public SynchronizedDoubleBag with(double element)
with
in interface MutableDoubleBag
with
in interface MutableDoubleCollection
with
in class AbstractSynchronizedDoubleCollection
public SynchronizedDoubleBag without(double element)
without
in interface MutableDoubleBag
without
in interface MutableDoubleCollection
without
in class AbstractSynchronizedDoubleCollection
public SynchronizedDoubleBag withAll(DoubleIterable elements)
withAll
in interface MutableDoubleBag
withAll
in interface MutableDoubleCollection
withAll
in class AbstractSynchronizedDoubleCollection
public SynchronizedDoubleBag withoutAll(DoubleIterable elements)
withoutAll
in interface MutableDoubleBag
withoutAll
in interface MutableDoubleCollection
withoutAll
in class AbstractSynchronizedDoubleCollection
public void addOccurrences(double item, int occurrences)
addOccurrences
in interface MutableDoubleBag
public boolean removeOccurrences(double item, int occurrences)
removeOccurrences
in interface MutableDoubleBag
public int sizeDistinct()
DoubleBag
sizeDistinct
in interface DoubleBag
public int occurrencesOf(double item)
DoubleBag
occurrencesOf
in interface DoubleBag
public void forEachWithOccurrences(DoubleIntProcedure procedure)
DoubleBag
forEachWithOccurrences
in interface DoubleBag
public MutableDoubleBag select(DoublePredicate predicate)
DoubleIterable
select
in interface DoubleBag
select
in interface DoubleIterable
select
in interface MutableDoubleBag
select
in interface MutableDoubleCollection
select
in class AbstractSynchronizedDoubleCollection
public MutableDoubleBag selectByOccurrences(IntPredicate predicate)
MutableDoubleBag
selectByOccurrences
in interface DoubleBag
selectByOccurrences
in interface MutableDoubleBag
public MutableList<DoubleIntPair> topOccurrences(int count)
MutableDoubleBag
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 DoubleBag
topOccurrences
in interface MutableDoubleBag
public MutableList<DoubleIntPair> bottomOccurrences(int count)
MutableDoubleBag
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 DoubleBag
bottomOccurrences
in interface MutableDoubleBag
public MutableDoubleBag reject(DoublePredicate predicate)
DoubleIterable
reject
in interface DoubleBag
reject
in interface DoubleIterable
reject
in interface MutableDoubleBag
reject
in interface MutableDoubleCollection
reject
in class AbstractSynchronizedDoubleCollection
public <V> MutableBag<V> collect(DoubleToObjectFunction<? extends V> function)
DoubleIterable
collect
in interface DoubleBag
collect
in interface DoubleIterable
collect
in interface MutableDoubleBag
collect
in interface MutableDoubleCollection
collect
in class AbstractSynchronizedDoubleCollection
public boolean equals(Object otherBag)
DoubleBag
Bag.equals(Object)
.public int hashCode()
DoubleBag
Bag.hashCode()
.public LazyDoubleIterable asLazy()
DoubleIterable
asLazy
in interface DoubleIterable
asLazy
in class AbstractSynchronizedDoubleCollection
public MutableDoubleBag asUnmodifiable()
asUnmodifiable
in interface MutableDoubleBag
asUnmodifiable
in interface MutableDoubleCollection
asUnmodifiable
in class AbstractSynchronizedDoubleCollection
public MutableDoubleBag asSynchronized()
asSynchronized
in interface MutableDoubleBag
asSynchronized
in interface MutableDoubleCollection
asSynchronized
in class AbstractSynchronizedDoubleCollection
public ImmutableDoubleBag toImmutable()
MutableDoubleBag
toImmutable
in interface DoubleBag
toImmutable
in interface MutableDoubleBag
toImmutable
in interface MutableDoubleCollection
toImmutable
in class AbstractSynchronizedDoubleCollection
Copyright © 2004–2017. All rights reserved.