Class SynchronizedCharBag
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedCharCollection
org.eclipse.collections.impl.bag.mutable.primitive.SynchronizedCharBag
- All Implemented Interfaces:
Serializable, CharBag, MutableCharBag, CharIterable, MutableCharCollection, PrimitiveIterable
public class SynchronizedCharBag
extends AbstractSynchronizedCharCollection
implements MutableCharBag
A synchronized view of a
MutableCharBag. It is imperative that the user manually synchronize on the collection when iterating over it using the
CharIterator, as per Collections.synchronizedCollection(Collection).
This file was automatically generated from template file synchronizedPrimitiveBag.stg.
- Since:
- 3.1.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOccurrences(char item, int occurrences) asLazy()Returns a LazyCharIterable adapter wrapping the source CharIterable.bottomOccurrences(int count) Returns thecountleast frequently occurring items.<V> MutableBag<V> collect(CharToObjectFunction<? extends V> function) Returns a new collection with the results of applying the specified function on each element of the source collection.booleanFollows the same general contract asBag.equals(Object).voidforEachWithOccurrences(CharIntProcedure procedure) For each distinct item, with the number of occurrences, execute the specified procedure.private MutableCharBaginthashCode()Follows the same general contract asBag.hashCode().newEmpty()Creates a new empty mutable version of the same collection type.intoccurrencesOf(char item) The occurrences of a distinct item in the bag.reject(CharPredicate predicate) Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.booleanremoveOccurrences(char item, int occurrences) select(CharPredicate predicate) Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.selectByOccurrences(IntPredicate predicate) Returns all elements of the bag that have a number of occurrences that satisfy the predicate.Returns all elements of the bag that have exactly one occurrence.intThe size of the Bag when counting only distinct elements.Returns an immutable copy of this bag.topOccurrences(int count) Returns thecountmost frequently occurring items.with(char element) withAll(CharIterable elements) without(char element) withoutAll(CharIterable elements) Methods inherited from class AbstractSynchronizedCharCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, charIterator, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getCharCollection, getLock, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toStringMethods inherited from interface CharBag
toStringOfItemToCountMethods inherited from interface CharIterable
allSatisfy, anySatisfy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListByMethods inherited from interface MutableCharBag
selectDuplicates, tapMethods inherited from interface MutableCharCollection
add, addAll, addAll, charIterator, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAllMethods inherited from interface PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
SynchronizedCharBag
-
SynchronizedCharBag
-
-
Method Details
-
getMutableCharBag
-
with
- Specified by:
within interfaceMutableCharBag- Specified by:
within interfaceMutableCharCollection- Overrides:
within classAbstractSynchronizedCharCollection
-
without
- Specified by:
withoutin interfaceMutableCharBag- Specified by:
withoutin interfaceMutableCharCollection- Overrides:
withoutin classAbstractSynchronizedCharCollection
-
withAll
- Specified by:
withAllin interfaceMutableCharBag- Specified by:
withAllin interfaceMutableCharCollection- Overrides:
withAllin classAbstractSynchronizedCharCollection
-
withoutAll
- Specified by:
withoutAllin interfaceMutableCharBag- Specified by:
withoutAllin interfaceMutableCharCollection- Overrides:
withoutAllin classAbstractSynchronizedCharCollection
-
addOccurrences
public void addOccurrences(char item, int occurrences) - Specified by:
addOccurrencesin interfaceMutableCharBag
-
removeOccurrences
public boolean removeOccurrences(char item, int occurrences) - Specified by:
removeOccurrencesin interfaceMutableCharBag
-
sizeDistinct
public int sizeDistinct()Description copied from interface:CharBagThe size of the Bag when counting only distinct elements.- Specified by:
sizeDistinctin interfaceCharBag
-
occurrencesOf
public int occurrencesOf(char item) Description copied from interface:CharBagThe occurrences of a distinct item in the bag.- Specified by:
occurrencesOfin interfaceCharBag
-
forEachWithOccurrences
Description copied from interface:CharBagFor each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
forEachWithOccurrencesin interfaceCharBag
-
select
Description copied from interface:CharIterableReturns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.- Specified by:
selectin interfaceCharBag- Specified by:
selectin interfaceCharIterable- Specified by:
selectin interfaceMutableCharBag- Specified by:
selectin interfaceMutableCharCollection- Overrides:
selectin classAbstractSynchronizedCharCollection
-
selectByOccurrences
Description copied from interface:MutableCharBagReturns all elements of the bag that have a number of occurrences that satisfy the predicate.- Specified by:
selectByOccurrencesin interfaceCharBag- Specified by:
selectByOccurrencesin interfaceMutableCharBag
-
selectUnique
Description copied from interface:MutableCharBagReturns all elements of the bag that have exactly one occurrence.- Specified by:
selectUniquein interfaceCharBag- Specified by:
selectUniquein interfaceMutableCharBag
-
topOccurrences
Description copied from interface:MutableCharBagReturns thecountmost 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.- Specified by:
topOccurrencesin interfaceCharBag- Specified by:
topOccurrencesin interfaceMutableCharBag
-
bottomOccurrences
Description copied from interface:MutableCharBagReturns thecountleast 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.- Specified by:
bottomOccurrencesin interfaceCharBag- Specified by:
bottomOccurrencesin interfaceMutableCharBag
-
reject
Description copied from interface:CharIterableReturns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.- Specified by:
rejectin interfaceCharBag- Specified by:
rejectin interfaceCharIterable- Specified by:
rejectin interfaceMutableCharBag- Specified by:
rejectin interfaceMutableCharCollection- Overrides:
rejectin classAbstractSynchronizedCharCollection
-
collect
Description copied from interface:CharIterableReturns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collectin interfaceCharBag- Specified by:
collectin interfaceCharIterable- Specified by:
collectin interfaceMutableCharBag- Specified by:
collectin interfaceMutableCharCollection- Overrides:
collectin classAbstractSynchronizedCharCollection
-
equals
-
hashCode
-
asLazy
Description copied from interface:CharIterableReturns a LazyCharIterable adapter wrapping the source CharIterable.- Specified by:
asLazyin interfaceCharIterable- Overrides:
asLazyin classAbstractSynchronizedCharCollection
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableCharBag- Specified by:
asUnmodifiablein interfaceMutableCharCollection- Overrides:
asUnmodifiablein classAbstractSynchronizedCharCollection
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableCharBag- Specified by:
asSynchronizedin interfaceMutableCharCollection- Overrides:
asSynchronizedin classAbstractSynchronizedCharCollection
-
toImmutable
Description copied from interface:MutableCharBagReturns an immutable copy of this bag.- Specified by:
toImmutablein interfaceCharBag- Specified by:
toImmutablein interfaceMutableCharBag- Specified by:
toImmutablein interfaceMutableCharCollection- Overrides:
toImmutablein classAbstractSynchronizedCharCollection
-
newEmpty
Description copied from interface:MutableCharCollectionCreates a new empty mutable version of the same collection type.- Specified by:
newEmptyin interfaceMutableCharBag- Specified by:
newEmptyin interfaceMutableCharCollection- Since:
- 9.2.
-