Class UnmodifiableFloatBag
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableFloatCollection
-
- org.eclipse.collections.impl.bag.mutable.primitive.UnmodifiableFloatBag
-
- All Implemented Interfaces:
java.io.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
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description UnmodifiableFloatBag(MutableFloatBag bag)
-
Method Summary
All Methods Instance Methods Concrete Methods 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(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.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, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, floatIterator, getFloatCollection, 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, asLazy, 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
-
UnmodifiableFloatBag
public UnmodifiableFloatBag(MutableFloatBag bag)
-
-
Method Detail
-
getMutableFloatBag
private MutableFloatBag getMutableFloatBag()
-
with
public UnmodifiableFloatBag with(float element)
- Specified by:
with
in interfaceMutableFloatBag
- Specified by:
with
in interfaceMutableFloatCollection
- Overrides:
with
in classAbstractUnmodifiableFloatCollection
-
without
public UnmodifiableFloatBag without(float element)
- Specified by:
without
in interfaceMutableFloatBag
- Specified by:
without
in interfaceMutableFloatCollection
- Overrides:
without
in classAbstractUnmodifiableFloatCollection
-
withAll
public UnmodifiableFloatBag withAll(FloatIterable elements)
- Specified by:
withAll
in interfaceMutableFloatBag
- Specified by:
withAll
in interfaceMutableFloatCollection
- Overrides:
withAll
in classAbstractUnmodifiableFloatCollection
-
withoutAll
public UnmodifiableFloatBag withoutAll(FloatIterable elements)
- 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
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
-
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
-
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 classAbstractUnmodifiableFloatCollection
-
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 classAbstractUnmodifiableFloatCollection
-
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 classAbstractUnmodifiableFloatCollection
-
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()
.
-
asUnmodifiable
public MutableFloatBag asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableFloatBag
- Specified by:
asUnmodifiable
in interfaceMutableFloatCollection
- Overrides:
asUnmodifiable
in classAbstractUnmodifiableFloatCollection
-
asSynchronized
public MutableFloatBag asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableFloatBag
- Specified by:
asSynchronized
in interfaceMutableFloatCollection
- Overrides:
asSynchronized
in classAbstractUnmodifiableFloatCollection
-
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 classAbstractUnmodifiableFloatCollection
-
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.
-
-