Class UnmodifiableFloatBag
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableFloatCollection
org.eclipse.collections.impl.bag.mutable.primitive.UnmodifiableFloatBag
- All Implemented Interfaces:
Serializable
,FloatBag
,MutableFloatBag
,MutableFloatCollection
,FloatIterable
,PrimitiveIterable
public class UnmodifiableFloatBag extends AbstractUnmodifiableFloatCollection implements MutableFloatBag
This file was automatically generated from template file unmodifiablePrimitiveBag.stg.
- Since:
- 3.1.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description UnmodifiableFloatBag(MutableFloatBag bag)
-
Method Summary
Modifier and Type Method Description void
addOccurrences(float item, int occurrences)
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.UnmodifiableFloatBag
with(float element)
UnmodifiableFloatBag
withAll(FloatIterable elements)
UnmodifiableFloatBag
without(float element)
UnmodifiableFloatBag
withoutAll(FloatIterable elements)
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableFloatCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, 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, asLazy, 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 classAbstractUnmodifiableFloatCollection
-
without
- Specified by:
without
in interfaceMutableFloatBag
- Specified by:
without
in interfaceMutableFloatCollection
- Overrides:
without
in classAbstractUnmodifiableFloatCollection
-
withAll
- Specified by:
withAll
in interfaceMutableFloatBag
- Specified by:
withAll
in interfaceMutableFloatCollection
- Overrides:
withAll
in classAbstractUnmodifiableFloatCollection
-
withoutAll
- Specified by:
withoutAll
in interfaceMutableFloatBag
- Specified by:
withoutAll
in interfaceMutableFloatCollection
- Overrides:
withoutAll
in classAbstractUnmodifiableFloatCollection
-
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
-
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
-
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 classAbstractUnmodifiableFloatCollection
-
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 classAbstractUnmodifiableFloatCollection
-
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 classAbstractUnmodifiableFloatCollection
-
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()
. -
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableFloatBag
- Specified by:
asUnmodifiable
in interfaceMutableFloatCollection
- Overrides:
asUnmodifiable
in classAbstractUnmodifiableFloatCollection
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableFloatBag
- Specified by:
asSynchronized
in interfaceMutableFloatCollection
- Overrides:
asSynchronized
in classAbstractUnmodifiableFloatCollection
-
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 classAbstractUnmodifiableFloatCollection
-
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.
-