Top Description Inners Fields Constructors Methods
org.eclipse.collections.impl.bag.mutable.primitive

public Class DoubleHashBag

extends AbstractDoubleIterable
implements MutableDoubleBag, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, org.eclipse.collections.api.bag.primitive.MutableDoubleBag, org.eclipse.collections.api.bag.primitive.DoubleBag, org.eclipse.collections.api.DoubleIterable, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.api.collection.primitive.MutableDoubleCollection
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, java.util.NoSuchElementException, org.eclipse.collections.api.DoubleIterable, .RichIterable, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.bag.primitive.DoubleBag, .ImmutableDoubleBag, .MutableDoubleBag, org.eclipse.collections.api.block.function.primitive.DoubleToObjectFunction, .IntFunction, .ObjectDoubleToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.IntPredicate, .DoublePredicate, org.eclipse.collections.api.block.procedure.primitive.DoubleProcedure, .DoubleIntProcedure, org.eclipse.collections.api.factory.Lists, org.eclipse.collections.api.iterator.DoubleIterator, .MutableDoubleIterator, org.eclipse.collections.api.set.primitive.DoubleSet, .MutableDoubleSet, org.eclipse.collections.api.tuple.primitive.DoubleIntPair, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.impl.Counter, org.eclipse.collections.impl.bag.mutable.HashBag, org.eclipse.collections.impl.block.factory.primitive.IntToIntFunctions, org.eclipse.collections.impl.factory.primitive.DoubleBags, .DoubleSets, org.eclipse.collections.impl.map.mutable.primitive.DoubleIntHashMap, org.eclipse.collections.impl.primitive.AbstractDoubleIterable, org.eclipse.collections.impl.set.mutable.primitive.DoubleHashSet, org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples

DoubleHashBag is similar to HashBag, and is memory-optimized for double primitives. This file was automatically generated from template file primitiveHashBag.stg.
Since
3.0.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private DoubleIntHashMap
private static final long
private int

Constructor Summary

AccessConstructor and Description
public
public
DoubleHashBag(int size)

public
public
DoubleHashBag(double... elements)

public

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public boolean
public void
public boolean
allSatisfy(DoublePredicate predicate)

Implements org.eclipse.collections.api.DoubleIterable.allSatisfy.

Returns true if all of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.

public boolean
anySatisfy(DoublePredicate predicate)

Implements org.eclipse.collections.api.DoubleIterable.anySatisfy.

Returns true if any of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.

public void
appendString(Appendable appendable, String start, String separator, String end)

Implements org.eclipse.collections.api.PrimitiveIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public MutableDoubleBag
public MutableDoubleBag
public MutableList<DoubleIntPair>
bottomOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableDoubleBag.bottomOccurrences.

Returns the count least frequently occurring items.

public RichIterable<DoubleIterable>
chunk(int size)

Overrides default org.eclipse.collections.api.DoubleIterable.chunk.

Partitions elements in fixed size chunks.

public void
public <V> MutableBag<V>
collect(DoubleToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.bag.primitive.MutableDoubleBag.collect, org.eclipse.collections.api.DoubleIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public boolean
contains(double value)

Implements org.eclipse.collections.api.DoubleIterable.contains.

Returns true if the value is contained in the DoubleIterable, and false if it is not.

public int
count(DoublePredicate predicate)

Implements org.eclipse.collections.api.DoubleIterable.count.

Returns a count of the number of elements in the DoubleIterable that return true for the specified predicate.

public double
public MutableDoubleIterator
doubleIterator()

Implements org.eclipse.collections.api.collection.primitive.MutableDoubleCollection.doubleIterator, org.eclipse.collections.api.DoubleIterable.doubleIterator.

Returns a primitive iterator that can be used to iterate over the DoubleIterable in an imperative style.

public void
each(DoubleProcedure procedure)

Implements org.eclipse.collections.api.DoubleIterable.each.

A synonym for forEach.

public boolean
equals(Object otherBag)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.bag.primitive.DoubleBag.equals.

Follows the same general contract as Bag#equals(Object).

public void
forEachWithOccurrences(DoubleIntProcedure procedure)

Implements org.eclipse.collections.api.bag.primitive.DoubleBag.forEachWithOccurrences.

For each distinct item, with the number of occurrences, execute the specified procedure.

public int
public <T> T
injectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T, ? extends T> function)

Implements org.eclipse.collections.api.DoubleIterable.injectInto.

public boolean
isEmpty()

Overrides default org.eclipse.collections.api.PrimitiveIterable.isEmpty.

Returns true if this iterable has zero items.

public double
public double
public static DoubleHashBag
newBag(int size)

public static DoubleHashBag
public static DoubleHashBag
newBag(DoubleBag source)

public static DoubleHashBag
newBagWith(double... source)

public DoubleHashBag
newEmpty()

Overrides default org.eclipse.collections.api.bag.primitive.MutableDoubleBag.newEmpty.

Creates a new empty DoubleHashBag.

public boolean
noneSatisfy(DoublePredicate predicate)

Overrides default org.eclipse.collections.api.DoubleIterable.noneSatisfy.

Returns true if none of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.

public boolean
notEmpty()

Overrides default org.eclipse.collections.api.PrimitiveIterable.notEmpty.

The English equivalent of !this.isEmpty()

public int
occurrencesOf(double item)

Implements org.eclipse.collections.api.bag.primitive.DoubleBag.occurrencesOf.

The occurrences of a distinct item in the bag.

protected MutableList<DoubleIntPair>
public void
readExternal(ObjectInput in)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public DoubleHashBag
reject(DoublePredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableDoubleBag.reject, org.eclipse.collections.api.DoubleIterable.reject.

Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public DoubleHashBag
select(DoublePredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableDoubleBag.select, org.eclipse.collections.api.DoubleIterable.select.

Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.

public DoubleHashBag
selectByOccurrences(IntPredicate predicate)

Implements org.eclipse.collections.api.bag.primitive.MutableDoubleBag.selectByOccurrences.

Returns all elements of the bag that have a number of occurrences that satisfy the predicate.

public MutableDoubleSet
selectUnique()

Implements org.eclipse.collections.api.bag.primitive.MutableDoubleBag.selectUnique.

Returns all elements of the bag that have exactly one occurrence.

public int
size()

Implements org.eclipse.collections.api.PrimitiveIterable.size.

Returns the number of items in this iterable.

public int
sizeDistinct()

Implements org.eclipse.collections.api.bag.primitive.DoubleBag.sizeDistinct.

The size of the Bag when counting only distinct elements.

public double
public double[]
toArray()

Implements org.eclipse.collections.api.DoubleIterable.toArray.

Converts the DoubleIterable to a primitive double array.

public double[]
toArray(double[] array)

Overrides default org.eclipse.collections.api.DoubleIterable.toArray.

Converts the DoubleIterable to a primitive double array.

public ImmutableDoubleBag
toImmutable()

Implements org.eclipse.collections.api.bag.primitive.MutableDoubleBag.toImmutable.

Returns an immutable copy of this bag.

protected MutableList<DoubleIntPair>
public MutableList<DoubleIntPair>
topOccurrences(int count)

Implements org.eclipse.collections.api.bag.primitive.MutableDoubleBag.topOccurrences.

Returns the count most frequently occurring items.

public DoubleHashBag
public DoubleHashBag
with(double element1, double element2)

public DoubleHashBag
with(double element1, double element2, double element3)

public DoubleHashBag
public DoubleHashBag
public DoubleHashBag
public void
writeExternal(ObjectOutput out)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.eclipse.collections.impl.primitive.AbstractDoubleIterable:
asLazyaveragemaxIfEmptymedianminIfEmptytoBagtoListtoSettoSortedArraytoSortedListtoString