Class SynchronizedFloatBag
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedFloatCollection
org.eclipse.collections.impl.bag.mutable.primitive.SynchronizedFloatBag
- All Implemented Interfaces:
Serializable
,FloatBag
,MutableFloatBag
,MutableFloatCollection
,FloatIterable
,PrimitiveIterable
public class SynchronizedFloatBag extends AbstractSynchronizedFloatCollection implements MutableFloatBag
A synchronized view of a
MutableFloatBag
. It is imperative that the user manually synchronize on the collection when iterating over it using the
FloatIterator
, as per Collections.synchronizedCollection(Collection)
.
This file was automatically generated from template file synchronizedPrimitiveBag.stg.
- Since:
- 3.1.
- See Also:
MutableFloatBag.asSynchronized()
,MutableBag.asSynchronized()
, Serialized Form
-
Constructor Summary
Constructors Constructor Description SynchronizedFloatBag(MutableFloatBag bag)
SynchronizedFloatBag(MutableFloatBag bag, Object newLock)
-
Method Summary
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(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.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, count, detectIfNone, each, floatIterator, forEach, 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 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, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList
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
-
Constructor Details
-
Method Details
-
with
- Specified by:
with
in interfaceMutableFloatBag
- Specified by:
with
in interfaceMutableFloatCollection
- Overrides:
with
in classAbstractSynchronizedFloatCollection
-
without
- Specified by:
without
in interfaceMutableFloatBag
- Specified by:
without
in interfaceMutableFloatCollection
- Overrides:
without
in classAbstractSynchronizedFloatCollection
-
withAll
- Specified by:
withAll
in interfaceMutableFloatBag
- Specified by:
withAll
in interfaceMutableFloatCollection
- Overrides:
withAll
in classAbstractSynchronizedFloatCollection
-
withoutAll
- 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
Description copied from interface:FloatBag
For each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
forEachWithOccurrences
in interfaceFloatBag
-
select
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
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
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
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
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
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
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
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
Description copied from interface:FloatIterable
Returns a LazyFloatIterable adapter wrapping the source FloatIterable.- Specified by:
asLazy
in interfaceFloatIterable
- Overrides:
asLazy
in classAbstractSynchronizedFloatCollection
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableFloatBag
- Specified by:
asUnmodifiable
in interfaceMutableFloatCollection
- Overrides:
asUnmodifiable
in classAbstractSynchronizedFloatCollection
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableFloatBag
- Specified by:
asSynchronized
in interfaceMutableFloatCollection
- Overrides:
asSynchronized
in classAbstractSynchronizedFloatCollection
-
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
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.
-