public class SynchronizedBag<T> extends AbstractSynchronizedMutableCollection<T> implements MutableBag<T>, Serializable
MutableBag. It is imperative that the user manually synchronize on the collection when iterating over it using the
standard JDK iterator or JDK 5 for loop, as per Collections.synchronizedCollection(Collection).MutableBag.asSynchronized(),
Serialized Form| Constructor and Description |
|---|
SynchronizedBag(MutableBag<T> bag,
Object newLock) |
add, addAll, addAllIterable, aggregateBy, aggregateInPlaceBy, clear, countBy, countByEach, countByWith, groupByUniqueKey, injectIntoWith, remove, removeAll, removeAllIterable, removeIf, removeIfWith, retainAll, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, equals, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, forEachWith, forEachWithIndex, getFirst, getLast, getOnly, groupBy, groupByEach, groupByUniqueKey, hashCode, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, iterator, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, select, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableList, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toString, zip, zipWithIndexequals, getClass, hashCode, notify, notifyAll, wait, wait, waitcountBy, countByEach, countByWith, flatCollectWith, selectDuplicates, toImmutableBag, with, withAll, without, withoutAllaggregateBy, equals, hashCode, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLongaddAllIterable, aggregateBy, aggregateInPlaceBy, groupByUniqueKey, injectIntoWith, removeAllIterable, removeIf, removeIfWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArrayallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reject, rejectWith, select, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexforEach, forEachWith, forEachWithIndexpublic SynchronizedBag(MutableBag<T> bag, Object newLock)
public static <E,B extends MutableBag<E>> SynchronizedBag<E> of(B bag)
public static <E,B extends MutableBag<E>> SynchronizedBag<E> of(B bag, Object lock)
public MutableBag<T> newEmpty()
newEmpty in interface MutableBag<T>newEmpty in interface MutableCollection<T>public int addOccurrences(T item, int occurrences)
addOccurrences in interface MutableBagIterable<T>public boolean removeOccurrences(Object item, int occurrences)
removeOccurrences in interface MutableBagIterable<T>public boolean setOccurrences(T item, int occurrences)
setOccurrences in interface MutableBagIterable<T>public MutableMap<T,Integer> toMapOfItemToCount()
toMapOfItemToCount in interface Bag<T>toMapOfItemToCount in interface MutableBag<T>toMapOfItemToCount in interface MutableBagIterable<T>public MutableBag<T> selectByOccurrences(IntPredicate predicate)
selectByOccurrences in interface Bag<T>selectByOccurrences in interface MutableBag<T>selectByOccurrences in interface MutableBagIterable<T>selectByOccurrences in interface UnsortedBag<T>public MutableList<ObjectIntPair<T>> topOccurrences(int count)
topOccurrences in interface Bag<T>topOccurrences in interface MutableBagIterable<T>public MutableList<ObjectIntPair<T>> bottomOccurrences(int count)
bottomOccurrences in interface Bag<T>bottomOccurrences in interface MutableBagIterable<T>public boolean anySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
anySatisfyWithOccurrences in interface Bag<T>public boolean allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
allSatisfyWithOccurrences in interface Bag<T>public boolean noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
noneSatisfyWithOccurrences in interface Bag<T>public T detectWithOccurrences(ObjectIntPredicate<? super T> predicate)
detectWithOccurrences in interface Bag<T>public void forEachWithOccurrences(ObjectIntProcedure<? super T> objectIntProcedure)
forEachWithOccurrences in interface Bag<T>public <V> MutableBag<V> collectWithOccurrences(ObjectIntToObjectFunction<? super T,? extends V> function)
collectWithOccurrences in interface Bag<T>collectWithOccurrences in interface MutableBag<T>collectWithOccurrences in interface MutableBagIterable<T>collectWithOccurrences in interface UnsortedBag<T>public <V,R extends Collection<V>> R collectWithOccurrences(ObjectIntToObjectFunction<? super T,? extends V> function, R target)
collectWithOccurrences in interface Bag<T>public int occurrencesOf(Object item)
occurrencesOf in interface Bag<T>public int sizeDistinct()
sizeDistinct in interface Bag<T>public String toStringOfItemToCount()
toStringOfItemToCount in interface Bag<T>public MutableBag<T> tap(Procedure<? super T> procedure)
tap in interface Bag<T>tap in interface MutableBag<T>tap in interface MutableBagIterable<T>tap in interface UnsortedBag<T>tap in interface MutableCollection<T>tap in interface RichIterable<T>tap in class AbstractSynchronizedMutableCollection<T>public MutableBag<T> select(Predicate<? super T> predicate)
select in interface Bag<T>select in interface MutableBag<T>select in interface MutableBagIterable<T>select in interface UnsortedBag<T>select in interface MutableCollection<T>select in interface RichIterable<T>select in class AbstractSynchronizedMutableCollection<T>public <P> MutableBag<T> selectWith(Predicate2<? super T,? super P> predicate, P parameter)
selectWith in interface Bag<T>selectWith in interface MutableBag<T>selectWith in interface MutableBagIterable<T>selectWith in interface UnsortedBag<T>selectWith in interface MutableCollection<T>selectWith in interface RichIterable<T>selectWith in class AbstractSynchronizedMutableCollection<T>public MutableBag<T> reject(Predicate<? super T> predicate)
reject in interface Bag<T>reject in interface MutableBag<T>reject in interface MutableBagIterable<T>reject in interface UnsortedBag<T>reject in interface MutableCollection<T>reject in interface RichIterable<T>reject in class AbstractSynchronizedMutableCollection<T>public <P> MutableBag<T> rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
rejectWith in interface Bag<T>rejectWith in interface MutableBag<T>rejectWith in interface MutableBagIterable<T>rejectWith in interface UnsortedBag<T>rejectWith in interface MutableCollection<T>rejectWith in interface RichIterable<T>rejectWith in class AbstractSynchronizedMutableCollection<T>public PartitionMutableBag<T> partition(Predicate<? super T> predicate)
partition in interface Bag<T>partition in interface MutableBag<T>partition in interface MutableBagIterable<T>partition in interface UnsortedBag<T>partition in interface MutableCollection<T>partition in interface RichIterable<T>partition in class AbstractSynchronizedMutableCollection<T>public <P> PartitionMutableBag<T> partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
partitionWith in interface Bag<T>partitionWith in interface MutableBag<T>partitionWith in interface MutableBagIterable<T>partitionWith in interface MutableCollection<T>partitionWith in interface RichIterable<T>partitionWith in class AbstractSynchronizedMutableCollection<T>public MutableBooleanBag collectBoolean(BooleanFunction<? super T> booleanFunction)
collectBoolean in interface MutableBag<T>collectBoolean in interface UnsortedBag<T>collectBoolean in interface MutableCollection<T>collectBoolean in interface RichIterable<T>collectBoolean in class AbstractSynchronizedMutableCollection<T>public MutableByteBag collectByte(ByteFunction<? super T> byteFunction)
collectByte in interface MutableBag<T>collectByte in interface UnsortedBag<T>collectByte in interface MutableCollection<T>collectByte in interface RichIterable<T>collectByte in class AbstractSynchronizedMutableCollection<T>public MutableCharBag collectChar(CharFunction<? super T> charFunction)
collectChar in interface MutableBag<T>collectChar in interface UnsortedBag<T>collectChar in interface MutableCollection<T>collectChar in interface RichIterable<T>collectChar in class AbstractSynchronizedMutableCollection<T>public MutableDoubleBag collectDouble(DoubleFunction<? super T> doubleFunction)
collectDouble in interface MutableBag<T>collectDouble in interface UnsortedBag<T>collectDouble in interface MutableCollection<T>collectDouble in interface RichIterable<T>collectDouble in class AbstractSynchronizedMutableCollection<T>public MutableFloatBag collectFloat(FloatFunction<? super T> floatFunction)
collectFloat in interface MutableBag<T>collectFloat in interface UnsortedBag<T>collectFloat in interface MutableCollection<T>collectFloat in interface RichIterable<T>collectFloat in class AbstractSynchronizedMutableCollection<T>public MutableIntBag collectInt(IntFunction<? super T> intFunction)
collectInt in interface MutableBag<T>collectInt in interface UnsortedBag<T>collectInt in interface MutableCollection<T>collectInt in interface RichIterable<T>collectInt in class AbstractSynchronizedMutableCollection<T>public MutableLongBag collectLong(LongFunction<? super T> longFunction)
collectLong in interface MutableBag<T>collectLong in interface UnsortedBag<T>collectLong in interface MutableCollection<T>collectLong in interface RichIterable<T>collectLong in class AbstractSynchronizedMutableCollection<T>public MutableShortBag collectShort(ShortFunction<? super T> shortFunction)
collectShort in interface MutableBag<T>collectShort in interface UnsortedBag<T>collectShort in interface MutableCollection<T>collectShort in interface RichIterable<T>collectShort in class AbstractSynchronizedMutableCollection<T>public <S> MutableBag<S> selectInstancesOf(Class<S> clazz)
selectInstancesOf in interface Bag<T>selectInstancesOf in interface MutableBag<T>selectInstancesOf in interface MutableBagIterable<T>selectInstancesOf in interface UnsortedBag<T>selectInstancesOf in interface MutableCollection<T>selectInstancesOf in interface RichIterable<T>selectInstancesOf in class AbstractSynchronizedMutableCollection<T>public <V> MutableBag<V> collect(Function<? super T,? extends V> function)
collect in interface MutableBag<T>collect in interface UnsortedBag<T>collect in interface MutableCollection<T>collect in interface RichIterable<T>collect in class AbstractSynchronizedMutableCollection<T>@Deprecated public MutableSet<Pair<T,Integer>> zipWithIndex()
OrderedIterable.zipWithIndex() instead.zipWithIndex in interface Bag<T>zipWithIndex in interface MutableBag<T>zipWithIndex in interface MutableBagIterable<T>zipWithIndex in interface UnsortedBag<T>zipWithIndex in interface MutableCollection<T>zipWithIndex in interface RichIterable<T>zipWithIndex in class AbstractSynchronizedMutableCollection<T>public <P,V> MutableBag<V> collectWith(Function2<? super T,? super P,? extends V> function, P parameter)
collectWith in interface MutableBag<T>collectWith in interface UnsortedBag<T>collectWith in interface MutableCollection<T>collectWith in interface RichIterable<T>collectWith in class AbstractSynchronizedMutableCollection<T>public <V> MutableBag<V> collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
collectIf in interface MutableBag<T>collectIf in interface UnsortedBag<T>collectIf in interface MutableCollection<T>collectIf in interface RichIterable<T>collectIf in class AbstractSynchronizedMutableCollection<T>public <V> MutableBag<V> flatCollect(Function<? super T,? extends Iterable<V>> function)
flatCollect in interface MutableBag<T>flatCollect in interface UnsortedBag<T>flatCollect in interface MutableCollection<T>flatCollect in interface RichIterable<T>flatCollect in class AbstractSynchronizedMutableCollection<T>public <V> MutableBagMultimap<V,T> groupBy(Function<? super T,? extends V> function)
groupBy in interface Bag<T>groupBy in interface MutableBag<T>groupBy in interface MutableBagIterable<T>groupBy in interface UnsortedBag<T>groupBy in interface MutableCollection<T>groupBy in interface RichIterable<T>groupBy in class AbstractSynchronizedMutableCollection<T>public <V> MutableBagMultimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
groupByEach in interface Bag<T>groupByEach in interface MutableBag<T>groupByEach in interface MutableBagIterable<T>groupByEach in interface UnsortedBag<T>groupByEach in interface MutableCollection<T>groupByEach in interface RichIterable<T>groupByEach in class AbstractSynchronizedMutableCollection<T>@Deprecated public <S> MutableBag<Pair<T,S>> zip(Iterable<S> that)
OrderedIterable.zip(Iterable) instead.zip in interface MutableBag<T>zip in interface UnsortedBag<T>zip in interface MutableCollection<T>zip in interface RichIterable<T>zip in class AbstractSynchronizedMutableCollection<T>public MutableBag<T> asUnmodifiable()
asUnmodifiable in interface MutableBag<T>asUnmodifiable in interface MutableCollection<T>public MutableBag<T> asSynchronized()
asSynchronized in interface MutableBag<T>asSynchronized in interface MutableCollection<T>public ImmutableBag<T> toImmutable()
toImmutable in interface Bag<T>toImmutable in interface MutableBag<T>toImmutable in interface MutableCollection<T>public MutableSet<T> selectUnique()
selectUnique in interface Bag<T>selectUnique in interface MutableBag<T>selectUnique in interface MutableBagIterable<T>selectUnique in interface UnsortedBag<T>public RichIterable<T> distinctView()
distinctView in interface Bag<T>Copyright © 2004–2022. All rights reserved.