@NotThreadSafe public final class DoubleHashBag extends AbstractDoubleIterable implements MutableDoubleBag, Externalizable
HashBag, and is memory-optimized for double primitives.
This file was automatically generated from template file primitiveHashBag.stg.| Constructor and Description |
|---|
DoubleHashBag() |
DoubleHashBag(double... elements) |
DoubleHashBag(DoubleHashBag bag) |
DoubleHashBag(DoubleIterable iterable) |
DoubleHashBag(int size) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(double item) |
boolean |
addAll(double... source) |
boolean |
addAll(DoubleIterable source) |
void |
addOccurrences(double item,
int occurrences) |
boolean |
allSatisfy(DoublePredicate predicate) |
boolean |
anySatisfy(DoublePredicate predicate) |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable. |
MutableDoubleBag |
asSynchronized() |
MutableDoubleBag |
asUnmodifiable() |
MutableList<DoubleIntPair> |
bottomOccurrences(int count)
Returns the
count least frequently occurring items. |
void |
clear() |
<V> MutableBag<V> |
collect(DoubleToObjectFunction<? extends V> function) |
boolean |
contains(double value) |
int |
count(DoublePredicate predicate) |
double |
detectIfNone(DoublePredicate predicate,
double ifNone) |
MutableDoubleIterator |
doubleIterator() |
void |
each(DoubleProcedure procedure) |
boolean |
equals(Object otherBag)
Follows the same general contract as
Bag.equals(Object). |
void |
forEach(DoubleProcedure procedure) |
void |
forEachWithOccurrences(DoubleIntProcedure procedure)
For each distinct item, with the number of occurrences, execute the specified procedure.
|
int |
hashCode()
Follows the same general contract as
Bag.hashCode(). |
<T> T |
injectInto(T injectedValue,
ObjectDoubleToObjectFunction<? super T,? extends T> function) |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
double |
max() |
double |
min() |
static DoubleHashBag |
newBag(DoubleBag source) |
static DoubleHashBag |
newBag(DoubleIterable source) |
static DoubleHashBag |
newBag(int size) |
static DoubleHashBag |
newBagWith(double... source) |
boolean |
noneSatisfy(DoublePredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
int |
occurrencesOf(double item)
The occurrences of a distinct item in the bag.
|
void |
readExternal(ObjectInput in) |
DoubleHashBag |
reject(DoublePredicate predicate) |
boolean |
remove(double item) |
boolean |
removeAll(double... source) |
boolean |
removeAll(DoubleIterable source) |
boolean |
removeOccurrences(double item,
int occurrences) |
boolean |
retainAll(double... source) |
boolean |
retainAll(DoubleIterable source) |
DoubleHashBag |
select(DoublePredicate predicate) |
DoubleHashBag |
selectByOccurrences(IntPredicate predicate)
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
int |
size()
Returns the number of items in this iterable.
|
int |
sizeDistinct()
The size of the Bag when counting only distinct elements.
|
double |
sum() |
double[] |
toArray() |
ImmutableDoubleBag |
toImmutable()
Returns an immutable copy of this bag.
|
MutableList<DoubleIntPair> |
topOccurrences(int count)
Returns the
count most frequently occurring items. |
DoubleHashBag |
with(double element) |
DoubleHashBag |
with(double element1,
double element2) |
DoubleHashBag |
with(double element1,
double element2,
double element3) |
DoubleHashBag |
withAll(DoubleIterable iterable) |
DoubleHashBag |
without(double element) |
DoubleHashBag |
withoutAll(DoubleIterable iterable) |
void |
writeExternal(ObjectOutput out) |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringasLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedListappendString, appendString, makeString, makeString, makeString, toStringpublic DoubleHashBag()
public DoubleHashBag(int size)
public DoubleHashBag(DoubleIterable iterable)
public DoubleHashBag(double... elements)
public DoubleHashBag(DoubleHashBag bag)
public static DoubleHashBag newBag(int size)
public static DoubleHashBag newBagWith(double... source)
public static DoubleHashBag newBag(DoubleIterable source)
public static DoubleHashBag newBag(DoubleBag source)
public boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic int sizeDistinct()
DoubleBagsizeDistinct in interface DoubleBagpublic void clear()
clear in interface MutableDoubleCollectionpublic DoubleHashBag with(double element)
with in interface MutableDoubleBagwith in interface MutableDoubleCollectionpublic DoubleHashBag with(double element1, double element2)
public DoubleHashBag with(double element1, double element2, double element3)
public DoubleHashBag withAll(DoubleIterable iterable)
withAll in interface MutableDoubleBagwithAll in interface MutableDoubleCollectionpublic DoubleHashBag without(double element)
without in interface MutableDoubleBagwithout in interface MutableDoubleCollectionpublic DoubleHashBag withoutAll(DoubleIterable iterable)
withoutAll in interface MutableDoubleBagwithoutAll in interface MutableDoubleCollectionpublic boolean contains(double value)
contains in interface DoubleIterablepublic int occurrencesOf(double item)
DoubleBagoccurrencesOf in interface DoubleBagpublic void forEachWithOccurrences(DoubleIntProcedure procedure)
DoubleBagforEachWithOccurrences in interface DoubleBagpublic DoubleHashBag selectByOccurrences(IntPredicate predicate)
MutableDoubleBagselectByOccurrences in interface DoubleBagselectByOccurrences in interface MutableDoubleBagpublic MutableList<DoubleIntPair> topOccurrences(int count)
MutableDoubleBagcount 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.topOccurrences in interface DoubleBagtopOccurrences in interface MutableDoubleBagpublic MutableList<DoubleIntPair> bottomOccurrences(int count)
MutableDoubleBagcount 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.bottomOccurrences in interface DoubleBagbottomOccurrences in interface MutableDoubleBagpublic boolean add(double item)
add in interface MutableDoubleCollectionpublic boolean remove(double item)
remove in interface MutableDoubleCollectionpublic boolean addAll(double... source)
addAll in interface MutableDoubleCollectionpublic boolean addAll(DoubleIterable source)
addAll in interface MutableDoubleCollectionpublic boolean removeAll(double... source)
removeAll in interface MutableDoubleCollectionpublic boolean removeAll(DoubleIterable source)
removeAll in interface MutableDoubleCollectionpublic boolean retainAll(DoubleIterable source)
retainAll in interface MutableDoubleCollectionCollection.retainAll(Collection)public boolean retainAll(double... source)
retainAll in interface MutableDoubleCollectionCollection.retainAll(Collection)public void addOccurrences(double item,
int occurrences)
addOccurrences in interface MutableDoubleBagpublic boolean removeOccurrences(double item,
int occurrences)
removeOccurrences in interface MutableDoubleBagpublic void forEach(DoubleProcedure procedure)
forEach in interface DoubleIterablepublic void each(DoubleProcedure procedure)
each in interface DoubleIterablepublic DoubleHashBag select(DoublePredicate predicate)
select in interface DoubleBagselect in interface MutableDoubleBagselect in interface MutableDoubleCollectionselect in interface DoubleIterablepublic DoubleHashBag reject(DoublePredicate predicate)
reject in interface DoubleBagreject in interface MutableDoubleBagreject in interface MutableDoubleCollectionreject in interface DoubleIterablepublic <T> T injectInto(T injectedValue,
ObjectDoubleToObjectFunction<? super T,? extends T> function)
injectInto in interface DoubleIterablepublic boolean equals(Object otherBag)
DoubleBagBag.equals(Object).public int hashCode()
DoubleBagBag.hashCode().public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic int count(DoublePredicate predicate)
count in interface DoubleIterablepublic boolean anySatisfy(DoublePredicate predicate)
anySatisfy in interface DoubleIterablepublic boolean allSatisfy(DoublePredicate predicate)
allSatisfy in interface DoubleIterablepublic boolean noneSatisfy(DoublePredicate predicate)
noneSatisfy in interface DoubleIterablepublic double detectIfNone(DoublePredicate predicate, double ifNone)
detectIfNone in interface DoubleIterablepublic <V> MutableBag<V> collect(DoubleToObjectFunction<? extends V> function)
collect in interface DoubleBagcollect in interface MutableDoubleBagcollect in interface MutableDoubleCollectioncollect in interface DoubleIterablepublic double max()
max in interface DoubleIterablepublic double min()
min in interface DoubleIterablepublic double sum()
sum in interface DoubleIterablepublic double[] toArray()
toArray in interface DoubleIterablepublic MutableDoubleBag asUnmodifiable()
asUnmodifiable in interface MutableDoubleBagasUnmodifiable in interface MutableDoubleCollectionpublic MutableDoubleBag asSynchronized()
asSynchronized in interface MutableDoubleBagasSynchronized in interface MutableDoubleCollectionpublic ImmutableDoubleBag toImmutable()
MutableDoubleBagtoImmutable in interface DoubleBagtoImmutable in interface MutableDoubleBagtoImmutable in interface MutableDoubleCollectionpublic MutableDoubleIterator doubleIterator()
doubleIterator in interface MutableDoubleCollectiondoubleIterator in interface DoubleIterablepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionCopyright © 2004–2016. All rights reserved.