Class SynchronizedDoubleBag
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedDoubleCollection
org.eclipse.collections.impl.bag.mutable.primitive.SynchronizedDoubleBag
- All Implemented Interfaces:
Serializable,DoubleBag,MutableDoubleBag,MutableDoubleCollection,DoubleIterable,PrimitiveIterable
public class SynchronizedDoubleBag
extends AbstractSynchronizedDoubleCollection
implements MutableDoubleBag
A synchronized view of a
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.
- Since:
- 3.1.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOccurrences(double item, int occurrences) asLazy()Returns a LazyDoubleIterable adapter wrapping the source DoubleIterable.bottomOccurrences(int count) Returns thecountleast 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.booleanFollows the same general contract asBag.equals(Object).voidforEachWithOccurrences(DoubleIntProcedure procedure) For each distinct item, with the number of occurrences, execute the specified procedure.inthashCode()Follows the same general contract asBag.hashCode().newEmpty()Creates a new empty mutable version of the same Bag type.intoccurrencesOf(double item) The occurrences of a distinct item in the bag.reject(DoublePredicate predicate) Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.booleanremoveOccurrences(double item, int occurrences) select(DoublePredicate predicate) Returns a new DoubleIterable with all of the elements in the DoubleIterable 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(double element) withAll(DoubleIterable elements) without(double element) withoutAll(DoubleIterable elements) Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedDoubleCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, doubleIterator, each, 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 org.eclipse.collections.api.bag.primitive.DoubleBag
toStringOfItemToCountMethods inherited from interface org.eclipse.collections.api.DoubleIterable
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 org.eclipse.collections.api.bag.primitive.MutableDoubleBag
selectDuplicates, tapMethods inherited from interface org.eclipse.collections.api.collection.primitive.MutableDoubleCollection
add, addAll, addAll, clear, doubleIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAllMethods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Constructor Details
-
SynchronizedDoubleBag
-
SynchronizedDoubleBag
-
-
Method Details
-
with
- Specified by:
within interfaceMutableDoubleBag- Specified by:
within interfaceMutableDoubleCollection- Overrides:
within classAbstractSynchronizedDoubleCollection
-
without
- Specified by:
withoutin interfaceMutableDoubleBag- Specified by:
withoutin interfaceMutableDoubleCollection- Overrides:
withoutin classAbstractSynchronizedDoubleCollection
-
withAll
- Specified by:
withAllin interfaceMutableDoubleBag- Specified by:
withAllin interfaceMutableDoubleCollection- Overrides:
withAllin classAbstractSynchronizedDoubleCollection
-
withoutAll
- Specified by:
withoutAllin interfaceMutableDoubleBag- Specified by:
withoutAllin interfaceMutableDoubleCollection- Overrides:
withoutAllin classAbstractSynchronizedDoubleCollection
-
addOccurrences
public void addOccurrences(double item, int occurrences) - Specified by:
addOccurrencesin interfaceMutableDoubleBag
-
removeOccurrences
public boolean removeOccurrences(double item, int occurrences) - Specified by:
removeOccurrencesin interfaceMutableDoubleBag
-
sizeDistinct
public int sizeDistinct()Description copied from interface:DoubleBagThe size of the Bag when counting only distinct elements.- Specified by:
sizeDistinctin interfaceDoubleBag
-
occurrencesOf
public int occurrencesOf(double item) Description copied from interface:DoubleBagThe occurrences of a distinct item in the bag.- Specified by:
occurrencesOfin interfaceDoubleBag
-
forEachWithOccurrences
Description copied from interface:DoubleBagFor each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
forEachWithOccurrencesin interfaceDoubleBag
-
select
Description copied from interface:DoubleIterableReturns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.- Specified by:
selectin interfaceDoubleBag- Specified by:
selectin interfaceDoubleIterable- Specified by:
selectin interfaceMutableDoubleBag- Specified by:
selectin interfaceMutableDoubleCollection- Overrides:
selectin classAbstractSynchronizedDoubleCollection
-
selectByOccurrences
Description copied from interface:MutableDoubleBagReturns all elements of the bag that have a number of occurrences that satisfy the predicate.- Specified by:
selectByOccurrencesin interfaceDoubleBag- Specified by:
selectByOccurrencesin interfaceMutableDoubleBag
-
selectUnique
Description copied from interface:MutableDoubleBagReturns all elements of the bag that have exactly one occurrence.- Specified by:
selectUniquein interfaceDoubleBag- Specified by:
selectUniquein interfaceMutableDoubleBag
-
topOccurrences
Description copied from interface:MutableDoubleBagReturns 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 interfaceDoubleBag- Specified by:
topOccurrencesin interfaceMutableDoubleBag
-
bottomOccurrences
Description copied from interface:MutableDoubleBagReturns 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 interfaceDoubleBag- Specified by:
bottomOccurrencesin interfaceMutableDoubleBag
-
reject
Description copied from interface:DoubleIterableReturns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.- Specified by:
rejectin interfaceDoubleBag- Specified by:
rejectin interfaceDoubleIterable- Specified by:
rejectin interfaceMutableDoubleBag- Specified by:
rejectin interfaceMutableDoubleCollection- Overrides:
rejectin classAbstractSynchronizedDoubleCollection
-
collect
Description copied from interface:DoubleIterableReturns 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 interfaceDoubleBag- Specified by:
collectin interfaceDoubleIterable- Specified by:
collectin interfaceMutableDoubleBag- Specified by:
collectin interfaceMutableDoubleCollection- Overrides:
collectin classAbstractSynchronizedDoubleCollection
-
equals
Description copied from interface:DoubleBagFollows the same general contract asBag.equals(Object). -
hashCode
public int hashCode()Description copied from interface:DoubleBagFollows the same general contract asBag.hashCode(). -
asLazy
Description copied from interface:DoubleIterableReturns a LazyDoubleIterable adapter wrapping the source DoubleIterable.- Specified by:
asLazyin interfaceDoubleIterable- Overrides:
asLazyin classAbstractSynchronizedDoubleCollection
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableDoubleBag- Specified by:
asUnmodifiablein interfaceMutableDoubleCollection- Overrides:
asUnmodifiablein classAbstractSynchronizedDoubleCollection
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableDoubleBag- Specified by:
asSynchronizedin interfaceMutableDoubleCollection- Overrides:
asSynchronizedin classAbstractSynchronizedDoubleCollection
-
toImmutable
Description copied from interface:MutableDoubleBagReturns an immutable copy of this bag.- Specified by:
toImmutablein interfaceDoubleBag- Specified by:
toImmutablein interfaceMutableDoubleBag- Specified by:
toImmutablein interfaceMutableDoubleCollection- Overrides:
toImmutablein classAbstractSynchronizedDoubleCollection
-
newEmpty
Description copied from interface:MutableDoubleBagCreates a new empty mutable version of the same Bag type.- Specified by:
newEmptyin interfaceMutableDoubleBag- Specified by:
newEmptyin interfaceMutableDoubleCollection- Since:
- 9.2.
-