Class SynchronizedFloatBag
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedFloatCollection
-
- org.eclipse.collections.impl.bag.mutable.primitive.SynchronizedFloatBag
-
- All Implemented Interfaces:
java.io.Serializable
,FloatBag
,MutableFloatBag
,MutableFloatCollection
,FloatIterable
,PrimitiveIterable
public class SynchronizedFloatBag extends AbstractSynchronizedFloatCollection implements MutableFloatBag
A synchronized view of aMutableFloatBag
. It is imperative that the user manually synchronize on the collection when iterating over it using theFloatIterator
, as perCollections.synchronizedCollection(Collection)
.This file was automatically generated from template file synchronizedPrimitiveBag.stg.
- Since:
- 3.1.
- See Also:
MutableFloatBag.asSynchronized()
,MutableBag.asSynchronized()
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SynchronizedFloatBag(MutableFloatBag bag)
SynchronizedFloatBag(MutableFloatBag bag, java.lang.Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOccurrences(float item, int occurrences)
LazyFloatIterable
asLazy()
Returns a LazyFloatIterable adapter wrapping the source FloatIterable.MutableFloatBag
asSynchronized()
MutableFloatBag
asUnmodifiable()
MutableList<FloatIntPair>
bottomOccurrences(int count)
Returns thecount
least frequently occurring items.<V> MutableBag<V>
collect(FloatToObjectFunction<? 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 asBag.equals(Object)
.void
forEachWithOccurrences(FloatIntProcedure procedure)
For each distinct item, with the number of occurrences, execute the specified procedure.private MutableFloatBag
getMutableFloatBag()
int
hashCode()
Follows the same general contract asBag.hashCode()
.MutableFloatBag
newEmpty()
Creates a new empty mutable version of the same Bag type.int
occurrencesOf(float item)
The occurrences of a distinct item in the bag.MutableFloatBag
reject(FloatPredicate predicate)
Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.boolean
removeOccurrences(float item, int occurrences)
MutableFloatBag
select(FloatPredicate predicate)
Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.MutableFloatBag
selectByOccurrences(IntPredicate predicate)
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.MutableFloatSet
selectUnique()
Returns all elements of the bag that have exactly one occurrence.int
sizeDistinct()
The size of the Bag when counting only distinct elements.ImmutableFloatBag
toImmutable()
Returns an immutable copy of this bag.MutableList<FloatIntPair>
topOccurrences(int count)
Returns thecount
most frequently occurring items.SynchronizedFloatBag
with(float element)
SynchronizedFloatBag
withAll(FloatIterable elements)
SynchronizedFloatBag
without(float element)
SynchronizedFloatBag
withoutAll(FloatIterable elements)
-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedFloatCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, floatIterator, getFloatCollection, 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, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.FloatBag
toStringOfItemToCount
-
Methods inherited from interface org.eclipse.collections.api.FloatIterable
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, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableFloatBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableFloatCollection
add, addAll, addAll, clear, floatIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SynchronizedFloatBag
public SynchronizedFloatBag(MutableFloatBag bag)
-
SynchronizedFloatBag
public SynchronizedFloatBag(MutableFloatBag bag, java.lang.Object newLock)
-
-
Method Detail
-
getMutableFloatBag
private MutableFloatBag getMutableFloatBag()
-
with
public SynchronizedFloatBag with(float element)
- Specified by:
with
in interfaceMutableFloatBag
- Specified by:
with
in interfaceMutableFloatCollection
- Overrides:
with
in classAbstractSynchronizedFloatCollection
-
without
public SynchronizedFloatBag without(float element)
- Specified by:
without
in interfaceMutableFloatBag
- Specified by:
without
in interfaceMutableFloatCollection
- Overrides:
without
in classAbstractSynchronizedFloatCollection
-
withAll
public SynchronizedFloatBag withAll(FloatIterable elements)
- Specified by:
withAll
in interfaceMutableFloatBag
- Specified by:
withAll
in interfaceMutableFloatCollection
- Overrides:
withAll
in classAbstractSynchronizedFloatCollection
-
withoutAll
public SynchronizedFloatBag withoutAll(FloatIterable elements)
- Specified by:
withoutAll
in interfaceMutableFloatBag
- Specified by:
withoutAll
in interfaceMutableFloatCollection
- Overrides:
withoutAll
in classAbstractSynchronizedFloatCollection
-
addOccurrences
public void addOccurrences(float item, int occurrences)
- Specified by:
addOccurrences
in interfaceMutableFloatBag
-
removeOccurrences
public boolean removeOccurrences(float item, int occurrences)
- Specified by:
removeOccurrences
in interfaceMutableFloatBag
-
sizeDistinct
public int sizeDistinct()
Description copied from interface:FloatBag
The size of the Bag when counting only distinct elements.- Specified by:
sizeDistinct
in interfaceFloatBag
-
occurrencesOf
public int occurrencesOf(float item)
Description copied from interface:FloatBag
The occurrences of a distinct item in the bag.- Specified by:
occurrencesOf
in interfaceFloatBag
-
forEachWithOccurrences
public void forEachWithOccurrences(FloatIntProcedure procedure)
Description copied from interface:FloatBag
For each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
forEachWithOccurrences
in interfaceFloatBag
-
select
public MutableFloatBag select(FloatPredicate predicate)
Description copied from interface:FloatIterable
Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.- Specified by:
select
in interfaceFloatBag
- Specified by:
select
in interfaceFloatIterable
- Specified by:
select
in interfaceMutableFloatBag
- Specified by:
select
in interfaceMutableFloatCollection
- Overrides:
select
in classAbstractSynchronizedFloatCollection
-
selectByOccurrences
public MutableFloatBag selectByOccurrences(IntPredicate predicate)
Description copied from interface:MutableFloatBag
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.- Specified by:
selectByOccurrences
in interfaceFloatBag
- Specified by:
selectByOccurrences
in interfaceMutableFloatBag
-
selectUnique
public MutableFloatSet selectUnique()
Description copied from interface:MutableFloatBag
Returns all elements of the bag that have exactly one occurrence.- Specified by:
selectUnique
in interfaceFloatBag
- Specified by:
selectUnique
in interfaceMutableFloatBag
-
topOccurrences
public MutableList<FloatIntPair> topOccurrences(int count)
Description copied from interface:MutableFloatBag
Returns thecount
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.- Specified by:
topOccurrences
in interfaceFloatBag
- Specified by:
topOccurrences
in interfaceMutableFloatBag
-
bottomOccurrences
public MutableList<FloatIntPair> bottomOccurrences(int count)
Description copied from interface:MutableFloatBag
Returns thecount
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.- Specified by:
bottomOccurrences
in interfaceFloatBag
- Specified by:
bottomOccurrences
in interfaceMutableFloatBag
-
reject
public MutableFloatBag reject(FloatPredicate predicate)
Description copied from interface:FloatIterable
Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.- Specified by:
reject
in interfaceFloatBag
- Specified by:
reject
in interfaceFloatIterable
- Specified by:
reject
in interfaceMutableFloatBag
- Specified by:
reject
in interfaceMutableFloatCollection
- Overrides:
reject
in classAbstractSynchronizedFloatCollection
-
collect
public <V> MutableBag<V> collect(FloatToObjectFunction<? extends V> function)
Description copied from interface:FloatIterable
Returns 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:
collect
in interfaceFloatBag
- Specified by:
collect
in interfaceFloatIterable
- Specified by:
collect
in interfaceMutableFloatBag
- Specified by:
collect
in interfaceMutableFloatCollection
- Overrides:
collect
in classAbstractSynchronizedFloatCollection
-
equals
public boolean equals(java.lang.Object otherBag)
Description copied from interface:FloatBag
Follows the same general contract asBag.equals(Object)
.
-
hashCode
public int hashCode()
Description copied from interface:FloatBag
Follows the same general contract asBag.hashCode()
.
-
asLazy
public LazyFloatIterable asLazy()
Description copied from interface:FloatIterable
Returns a LazyFloatIterable adapter wrapping the source FloatIterable.- Specified by:
asLazy
in interfaceFloatIterable
- Overrides:
asLazy
in classAbstractSynchronizedFloatCollection
-
asUnmodifiable
public MutableFloatBag asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableFloatBag
- Specified by:
asUnmodifiable
in interfaceMutableFloatCollection
- Overrides:
asUnmodifiable
in classAbstractSynchronizedFloatCollection
-
asSynchronized
public MutableFloatBag asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableFloatBag
- Specified by:
asSynchronized
in interfaceMutableFloatCollection
- Overrides:
asSynchronized
in classAbstractSynchronizedFloatCollection
-
toImmutable
public ImmutableFloatBag toImmutable()
Description copied from interface:MutableFloatBag
Returns an immutable copy of this bag.- Specified by:
toImmutable
in interfaceFloatBag
- Specified by:
toImmutable
in interfaceMutableFloatBag
- Specified by:
toImmutable
in interfaceMutableFloatCollection
- Overrides:
toImmutable
in classAbstractSynchronizedFloatCollection
-
newEmpty
public MutableFloatBag newEmpty()
Description copied from interface:MutableFloatBag
Creates a new empty mutable version of the same Bag type.- Specified by:
newEmpty
in interfaceMutableFloatBag
- Specified by:
newEmpty
in interfaceMutableFloatCollection
- Since:
- 9.2.
-
-