BooleanBag
, MutableBooleanBag
, BooleanIterable
, MutableBooleanCollection
, PrimitiveIterable
public final class SynchronizedBooleanBag extends AbstractSynchronizedBooleanCollection implements MutableBooleanBag
MutableBooleanBag
. It is imperative that the user manually synchronize on the collection when iterating over it using the
BooleanIterator
, as per Collections.synchronizedCollection(Collection)
.
This file was automatically generated from template file synchronizedPrimitiveBag.stg.
MutableBooleanBag.asSynchronized()
,
MutableBag.asSynchronized()
,
Serialized FormConstructor | Description |
---|---|
SynchronizedBooleanBag(MutableBooleanBag bag) |
|
SynchronizedBooleanBag(MutableBooleanBag bag,
java.lang.Object newLock) |
Modifier and Type | Method | Description |
---|---|---|
void |
addOccurrences(boolean item,
int occurrences) |
|
LazyBooleanIterable |
asLazy() |
Returns a LazyBooleanIterable adapter wrapping the source BooleanIterable.
|
MutableBooleanBag |
asSynchronized() |
|
MutableBooleanBag |
asUnmodifiable() |
|
MutableList<BooleanIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
<V> MutableBag<V> |
collect(BooleanToObjectFunction<? 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(BooleanIntProcedure 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(boolean item) |
The occurrences of a distinct item in the bag.
|
MutableBooleanBag |
reject(BooleanPredicate predicate) |
Returns a new BooleanIterable with all of the elements in the BooleanIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(boolean item,
int occurrences) |
|
MutableBooleanBag |
select(BooleanPredicate predicate) |
Returns a new BooleanIterable with all of the elements in the BooleanIterable that
return true for the specified predicate.
|
MutableBooleanBag |
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.
|
ImmutableBooleanBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<BooleanIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
SynchronizedBooleanBag |
with(boolean element) |
|
SynchronizedBooleanBag |
withAll(BooleanIterable elements) |
|
SynchronizedBooleanBag |
without(boolean element) |
|
SynchronizedBooleanBag |
withoutAll(BooleanIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, booleanIterator, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, isEmpty, makeString, makeString, makeString, noneSatisfy, notEmpty, remove, removeAll, removeAll, retainAll, retainAll, size, toArray, toBag, toList, toSet, toString
allSatisfy, anySatisfy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, noneSatisfy, reject, select, toArray, toBag, toList, toSet
tap
add, addAll, addAll, booleanIterator, clear, remove, removeAll, removeAll, retainAll, retainAll
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
public SynchronizedBooleanBag(MutableBooleanBag bag)
public SynchronizedBooleanBag(MutableBooleanBag bag, java.lang.Object newLock)
public SynchronizedBooleanBag with(boolean element)
with
in interface MutableBooleanBag
with
in interface MutableBooleanCollection
with
in class AbstractSynchronizedBooleanCollection
public SynchronizedBooleanBag without(boolean element)
without
in interface MutableBooleanBag
without
in interface MutableBooleanCollection
without
in class AbstractSynchronizedBooleanCollection
public SynchronizedBooleanBag withAll(BooleanIterable elements)
withAll
in interface MutableBooleanBag
withAll
in interface MutableBooleanCollection
withAll
in class AbstractSynchronizedBooleanCollection
public SynchronizedBooleanBag withoutAll(BooleanIterable elements)
withoutAll
in interface MutableBooleanBag
withoutAll
in interface MutableBooleanCollection
withoutAll
in class AbstractSynchronizedBooleanCollection
public void addOccurrences(boolean item, int occurrences)
addOccurrences
in interface MutableBooleanBag
public boolean removeOccurrences(boolean item, int occurrences)
removeOccurrences
in interface MutableBooleanBag
public int sizeDistinct()
BooleanBag
sizeDistinct
in interface BooleanBag
public int occurrencesOf(boolean item)
BooleanBag
occurrencesOf
in interface BooleanBag
public void forEachWithOccurrences(BooleanIntProcedure procedure)
BooleanBag
forEachWithOccurrences
in interface BooleanBag
public MutableBooleanBag select(BooleanPredicate predicate)
BooleanIterable
select
in interface BooleanBag
select
in interface BooleanIterable
select
in interface MutableBooleanBag
select
in interface MutableBooleanCollection
select
in class AbstractSynchronizedBooleanCollection
public MutableBooleanBag selectByOccurrences(IntPredicate predicate)
MutableBooleanBag
selectByOccurrences
in interface BooleanBag
selectByOccurrences
in interface MutableBooleanBag
public MutableList<BooleanIntPair> topOccurrences(int count)
MutableBooleanBag
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 BooleanBag
topOccurrences
in interface MutableBooleanBag
public MutableList<BooleanIntPair> bottomOccurrences(int count)
MutableBooleanBag
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 BooleanBag
bottomOccurrences
in interface MutableBooleanBag
public MutableBooleanBag reject(BooleanPredicate predicate)
BooleanIterable
reject
in interface BooleanBag
reject
in interface BooleanIterable
reject
in interface MutableBooleanBag
reject
in interface MutableBooleanCollection
reject
in class AbstractSynchronizedBooleanCollection
public <V> MutableBag<V> collect(BooleanToObjectFunction<? extends V> function)
BooleanIterable
collect
in interface BooleanBag
collect
in interface BooleanIterable
collect
in interface MutableBooleanBag
collect
in interface MutableBooleanCollection
collect
in class AbstractSynchronizedBooleanCollection
public boolean equals(java.lang.Object otherBag)
BooleanBag
Bag.equals(Object)
.equals
in interface BooleanBag
equals
in class java.lang.Object
public int hashCode()
BooleanBag
Bag.hashCode()
.hashCode
in interface BooleanBag
hashCode
in class java.lang.Object
public LazyBooleanIterable asLazy()
BooleanIterable
asLazy
in interface BooleanIterable
asLazy
in class AbstractSynchronizedBooleanCollection
public MutableBooleanBag asUnmodifiable()
asUnmodifiable
in interface MutableBooleanBag
asUnmodifiable
in interface MutableBooleanCollection
asUnmodifiable
in class AbstractSynchronizedBooleanCollection
public MutableBooleanBag asSynchronized()
asSynchronized
in interface MutableBooleanBag
asSynchronized
in interface MutableBooleanCollection
asSynchronized
in class AbstractSynchronizedBooleanCollection
public ImmutableBooleanBag toImmutable()
MutableBooleanBag
toImmutable
in interface BooleanBag
toImmutable
in interface MutableBooleanBag
toImmutable
in interface MutableBooleanCollection
toImmutable
in class AbstractSynchronizedBooleanCollection
Copyright © 2004–2017. All rights reserved.