Class UnmodifiableDoubleBag
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableDoubleCollection
org.eclipse.collections.impl.bag.mutable.primitive.UnmodifiableDoubleBag
- All Implemented Interfaces:
Serializable
,DoubleBag
,MutableDoubleBag
,MutableDoubleCollection
,DoubleIterable
,PrimitiveIterable
public class UnmodifiableDoubleBag extends AbstractUnmodifiableDoubleCollection implements MutableDoubleBag
This file was automatically generated from template file unmodifiablePrimitiveBag.stg.
- Since:
- 3.1.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description UnmodifiableDoubleBag(MutableDoubleBag bag)
-
Method Summary
Modifier and Type Method Description void
addOccurrences(double item, int occurrences)
MutableDoubleBag
asSynchronized()
MutableDoubleBag
asUnmodifiable()
MutableList<DoubleIntPair>
bottomOccurrences(int count)
Returns thecount
least 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.boolean
equals(Object otherBag)
Follows the same general contract asBag.equals(Object)
.void
forEachWithOccurrences(DoubleIntProcedure procedure)
For each distinct item, with the number of occurrences, execute the specified procedure.int
hashCode()
Follows the same general contract asBag.hashCode()
.MutableDoubleBag
newEmpty()
Creates a new empty mutable version of the same Bag type.int
occurrencesOf(double item)
The occurrences of a distinct item in the bag.MutableDoubleBag
reject(DoublePredicate predicate)
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.boolean
removeOccurrences(double item, int occurrences)
MutableDoubleBag
select(DoublePredicate predicate)
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.MutableDoubleBag
selectByOccurrences(IntPredicate predicate)
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.MutableDoubleSet
selectUnique()
Returns all elements of the bag that have exactly one occurrence.int
sizeDistinct()
The size of the Bag when counting only distinct elements.ImmutableDoubleBag
toImmutable()
Returns an immutable copy of this bag.MutableList<DoubleIntPair>
topOccurrences(int count)
Returns thecount
most frequently occurring items.UnmodifiableDoubleBag
with(double element)
UnmodifiableDoubleBag
withAll(DoubleIterable elements)
UnmodifiableDoubleBag
without(double element)
UnmodifiableDoubleBag
withoutAll(DoubleIterable elements)
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableDoubleCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, chunk, clear, contains, containsAll, containsAll, count, detectIfNone, doubleIterator, each, 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.DoubleBag
toStringOfItemToCount
Methods inherited from interface org.eclipse.collections.api.DoubleIterable
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.MutableDoubleBag
selectDuplicates, tap
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableDoubleCollection
add, addAll, addAll, clear, doubleIterator, 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 interfaceMutableDoubleBag
- Specified by:
with
in interfaceMutableDoubleCollection
- Overrides:
with
in classAbstractUnmodifiableDoubleCollection
-
without
- Specified by:
without
in interfaceMutableDoubleBag
- Specified by:
without
in interfaceMutableDoubleCollection
- Overrides:
without
in classAbstractUnmodifiableDoubleCollection
-
withAll
- Specified by:
withAll
in interfaceMutableDoubleBag
- Specified by:
withAll
in interfaceMutableDoubleCollection
- Overrides:
withAll
in classAbstractUnmodifiableDoubleCollection
-
withoutAll
- Specified by:
withoutAll
in interfaceMutableDoubleBag
- Specified by:
withoutAll
in interfaceMutableDoubleCollection
- Overrides:
withoutAll
in classAbstractUnmodifiableDoubleCollection
-
addOccurrences
public void addOccurrences(double item, int occurrences)- Specified by:
addOccurrences
in interfaceMutableDoubleBag
-
removeOccurrences
public boolean removeOccurrences(double item, int occurrences)- Specified by:
removeOccurrences
in interfaceMutableDoubleBag
-
sizeDistinct
public int sizeDistinct()Description copied from interface:DoubleBag
The size of the Bag when counting only distinct elements.- Specified by:
sizeDistinct
in interfaceDoubleBag
-
occurrencesOf
public int occurrencesOf(double item)Description copied from interface:DoubleBag
The occurrences of a distinct item in the bag.- Specified by:
occurrencesOf
in interfaceDoubleBag
-
forEachWithOccurrences
Description copied from interface:DoubleBag
For each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
forEachWithOccurrences
in interfaceDoubleBag
-
selectByOccurrences
Description copied from interface:MutableDoubleBag
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.- Specified by:
selectByOccurrences
in interfaceDoubleBag
- Specified by:
selectByOccurrences
in interfaceMutableDoubleBag
-
selectUnique
Description copied from interface:MutableDoubleBag
Returns all elements of the bag that have exactly one occurrence.- Specified by:
selectUnique
in interfaceDoubleBag
- Specified by:
selectUnique
in interfaceMutableDoubleBag
-
topOccurrences
Description copied from interface:MutableDoubleBag
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 interfaceDoubleBag
- Specified by:
topOccurrences
in interfaceMutableDoubleBag
-
bottomOccurrences
Description copied from interface:MutableDoubleBag
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 interfaceDoubleBag
- Specified by:
bottomOccurrences
in interfaceMutableDoubleBag
-
select
Description copied from interface:DoubleIterable
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.- Specified by:
select
in interfaceDoubleBag
- Specified by:
select
in interfaceDoubleIterable
- Specified by:
select
in interfaceMutableDoubleBag
- Specified by:
select
in interfaceMutableDoubleCollection
- Overrides:
select
in classAbstractUnmodifiableDoubleCollection
-
reject
Description copied from interface:DoubleIterable
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.- Specified by:
reject
in interfaceDoubleBag
- Specified by:
reject
in interfaceDoubleIterable
- Specified by:
reject
in interfaceMutableDoubleBag
- Specified by:
reject
in interfaceMutableDoubleCollection
- Overrides:
reject
in classAbstractUnmodifiableDoubleCollection
-
collect
Description copied from interface:DoubleIterable
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 interfaceDoubleBag
- Specified by:
collect
in interfaceDoubleIterable
- Specified by:
collect
in interfaceMutableDoubleBag
- Specified by:
collect
in interfaceMutableDoubleCollection
- Overrides:
collect
in classAbstractUnmodifiableDoubleCollection
-
equals
Description copied from interface:DoubleBag
Follows the same general contract asBag.equals(Object)
. -
hashCode
public int hashCode()Description copied from interface:DoubleBag
Follows the same general contract asBag.hashCode()
. -
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableDoubleBag
- Specified by:
asUnmodifiable
in interfaceMutableDoubleCollection
- Overrides:
asUnmodifiable
in classAbstractUnmodifiableDoubleCollection
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableDoubleBag
- Specified by:
asSynchronized
in interfaceMutableDoubleCollection
- Overrides:
asSynchronized
in classAbstractUnmodifiableDoubleCollection
-
toImmutable
Description copied from interface:MutableDoubleBag
Returns an immutable copy of this bag.- Specified by:
toImmutable
in interfaceDoubleBag
- Specified by:
toImmutable
in interfaceMutableDoubleBag
- Specified by:
toImmutable
in interfaceMutableDoubleCollection
- Overrides:
toImmutable
in classAbstractUnmodifiableDoubleCollection
-
newEmpty
Description copied from interface:MutableDoubleBag
Creates a new empty mutable version of the same Bag type.- Specified by:
newEmpty
in interfaceMutableDoubleBag
- Specified by:
newEmpty
in interfaceMutableDoubleCollection
- Since:
- 9.2.
-