Class DoubleHashBag
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractDoubleIterable
-
- org.eclipse.collections.impl.bag.mutable.primitive.DoubleHashBag
-
- All Implemented Interfaces:
Externalizable,Serializable,DoubleBag,MutableDoubleBag,MutableDoubleCollection,DoubleIterable,PrimitiveIterable
public class DoubleHashBag extends AbstractDoubleIterable implements MutableDoubleBag, Externalizable
DoubleHashBag is similar toHashBag, and is memory-optimized for double primitives. This file was automatically generated from template file primitiveHashBag.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DoubleHashBag()DoubleHashBag(double... elements)DoubleHashBag(int size)DoubleHashBag(DoubleIterable iterable)DoubleHashBag(DoubleHashBag bag)
-
Method Summary
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractDoubleIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, 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
asLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableDoubleBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
-
-
-
Constructor Detail
-
DoubleHashBag
public DoubleHashBag()
-
DoubleHashBag
public DoubleHashBag(int size)
-
DoubleHashBag
public DoubleHashBag(DoubleIterable iterable)
-
DoubleHashBag
public DoubleHashBag(double... elements)
-
DoubleHashBag
public DoubleHashBag(DoubleHashBag bag)
-
-
Method Detail
-
newBag
public static DoubleHashBag newBag(int size)
-
newBagWith
public static DoubleHashBag newBagWith(double... source)
-
newBag
public static DoubleHashBag newBag(DoubleIterable source)
-
newBag
public static DoubleHashBag newBag(DoubleBag source)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmptyin interfacePrimitiveIterable
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
sizeDistinct
public int sizeDistinct()
- Specified by:
sizeDistinctin interfaceDoubleBag
-
clear
public void clear()
- Specified by:
clearin interfaceMutableDoubleCollection
-
with
public DoubleHashBag with(double element)
- Specified by:
within interfaceMutableDoubleBag- Specified by:
within interfaceMutableDoubleCollection
-
with
public DoubleHashBag with(double element1, double element2)
-
with
public DoubleHashBag with(double element1, double element2, double element3)
-
withAll
public DoubleHashBag withAll(DoubleIterable iterable)
- Specified by:
withAllin interfaceMutableDoubleBag- Specified by:
withAllin interfaceMutableDoubleCollection
-
without
public DoubleHashBag without(double element)
- Specified by:
withoutin interfaceMutableDoubleBag- Specified by:
withoutin interfaceMutableDoubleCollection
-
withoutAll
public DoubleHashBag withoutAll(DoubleIterable iterable)
- Specified by:
withoutAllin interfaceMutableDoubleBag- Specified by:
withoutAllin interfaceMutableDoubleCollection
-
contains
public boolean contains(double value)
- Specified by:
containsin interfaceDoubleIterable
-
occurrencesOf
public int occurrencesOf(double item)
- Specified by:
occurrencesOfin interfaceDoubleBag
-
forEachWithOccurrences
public void forEachWithOccurrences(DoubleIntProcedure procedure)
- Specified by:
forEachWithOccurrencesin interfaceDoubleBag
-
selectByOccurrences
public DoubleHashBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrencesin interfaceDoubleBag- Specified by:
selectByOccurrencesin interfaceMutableDoubleBag
-
selectUnique
public MutableDoubleSet selectUnique()
- Specified by:
selectUniquein interfaceDoubleBag- Specified by:
selectUniquein interfaceMutableDoubleBag
-
topOccurrences
public MutableList<DoubleIntPair> topOccurrences(int count)
- Specified by:
topOccurrencesin interfaceDoubleBag- Specified by:
topOccurrencesin interfaceMutableDoubleBag
-
bottomOccurrences
public MutableList<DoubleIntPair> bottomOccurrences(int count)
- Specified by:
bottomOccurrencesin interfaceDoubleBag- Specified by:
bottomOccurrencesin interfaceMutableDoubleBag
-
add
public boolean add(double item)
- Specified by:
addin interfaceMutableDoubleCollection
-
remove
public boolean remove(double item)
- Specified by:
removein interfaceMutableDoubleCollection
-
removeIf
public boolean removeIf(DoublePredicate predicate)
- Specified by:
removeIfin interfaceMutableDoubleCollection
-
addAll
public boolean addAll(double... source)
- Specified by:
addAllin interfaceMutableDoubleCollection
-
addAll
public boolean addAll(DoubleIterable source)
- Specified by:
addAllin interfaceMutableDoubleCollection
-
removeAll
public boolean removeAll(double... source)
- Specified by:
removeAllin interfaceMutableDoubleCollection
-
removeAll
public boolean removeAll(DoubleIterable source)
- Specified by:
removeAllin interfaceMutableDoubleCollection
-
retainAll
public boolean retainAll(DoubleIterable source)
- Specified by:
retainAllin interfaceMutableDoubleCollection
-
retainAll
public boolean retainAll(double... source)
- Specified by:
retainAllin interfaceMutableDoubleCollection
-
addOccurrences
public void addOccurrences(double item, int occurrences)- Specified by:
addOccurrencesin interfaceMutableDoubleBag
-
removeOccurrences
public boolean removeOccurrences(double item, int occurrences)- Specified by:
removeOccurrencesin interfaceMutableDoubleBag
-
each
public void each(DoubleProcedure procedure)
- Specified by:
eachin interfaceDoubleIterable- Since:
- 7.0.
-
select
public DoubleHashBag select(DoublePredicate predicate)
- Specified by:
selectin interfaceDoubleBag- Specified by:
selectin interfaceDoubleIterable- Specified by:
selectin interfaceMutableDoubleBag- Specified by:
selectin interfaceMutableDoubleCollection
-
reject
public DoubleHashBag reject(DoublePredicate predicate)
- Specified by:
rejectin interfaceDoubleBag- Specified by:
rejectin interfaceDoubleIterable- Specified by:
rejectin interfaceMutableDoubleBag- Specified by:
rejectin interfaceMutableDoubleCollection
-
injectInto
public <T> T injectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceDoubleIterable
-
chunk
public RichIterable<DoubleIterable> chunk(int size)
- Specified by:
chunkin interfaceDoubleIterable
-
equals
public boolean equals(Object otherBag)
-
hashCode
public int hashCode()
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
count
public int count(DoublePredicate predicate)
- Specified by:
countin interfaceDoubleIterable
-
anySatisfy
public boolean anySatisfy(DoublePredicate predicate)
- Specified by:
anySatisfyin interfaceDoubleIterable
-
allSatisfy
public boolean allSatisfy(DoublePredicate predicate)
- Specified by:
allSatisfyin interfaceDoubleIterable
-
noneSatisfy
public boolean noneSatisfy(DoublePredicate predicate)
- Specified by:
noneSatisfyin interfaceDoubleIterable
-
detectIfNone
public double detectIfNone(DoublePredicate predicate, double ifNone)
- Specified by:
detectIfNonein interfaceDoubleIterable
-
collect
public <V> MutableBag<V> collect(DoubleToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceDoubleBag- Specified by:
collectin interfaceDoubleIterable- Specified by:
collectin interfaceMutableDoubleBag- Specified by:
collectin interfaceMutableDoubleCollection
-
max
public double max()
- Specified by:
maxin interfaceDoubleIterable
-
min
public double min()
- Specified by:
minin interfaceDoubleIterable
-
sum
public double sum()
- Specified by:
sumin interfaceDoubleIterable
-
toArray
public double[] toArray()
- Specified by:
toArrayin interfaceDoubleIterable
-
toArray
public double[] toArray(double[] array)
- Specified by:
toArrayin interfaceDoubleIterable
-
asUnmodifiable
public MutableDoubleBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableDoubleBag- Specified by:
asUnmodifiablein interfaceMutableDoubleCollection
-
asSynchronized
public MutableDoubleBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableDoubleBag- Specified by:
asSynchronizedin interfaceMutableDoubleCollection
-
toImmutable
public ImmutableDoubleBag toImmutable()
- Specified by:
toImmutablein interfaceDoubleBag- Specified by:
toImmutablein interfaceMutableDoubleBag- Specified by:
toImmutablein interfaceMutableDoubleCollection
-
newEmpty
public DoubleHashBag newEmpty()
Creates a new empty DoubleHashBag.- Specified by:
newEmptyin interfaceMutableDoubleBag- Specified by:
newEmptyin interfaceMutableDoubleCollection- Since:
- 9.2.
-
doubleIterator
public MutableDoubleIterator doubleIterator()
- Specified by:
doubleIteratorin interfaceDoubleIterable- Specified by:
doubleIteratorin interfaceMutableDoubleCollection
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
-