Externalizable
, Serializable
, MutableDoubleCollection
, DoubleIterable
, PrimitiveIterable
, DoubleSet
, MutableDoubleSet
public final class DoubleHashSet extends AbstractDoubleSet implements MutableDoubleSet, Externalizable
Constructor | Description |
---|---|
DoubleHashSet() |
|
DoubleHashSet(double... elements) |
|
DoubleHashSet(int initialCapacity) |
|
DoubleHashSet(DoubleHashSet set) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(double element) |
|
boolean |
addAll(double... source) |
|
boolean |
addAll(DoubleIterable source) |
|
boolean |
allSatisfy(DoublePredicate predicate) |
Returns true if all of the elements in the DoubleIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(DoublePredicate predicate) |
Returns true if any of the elements in the DoubleIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
Prints a string representation of this collection onto the given
Appendable . |
MutableDoubleSet |
asSynchronized() |
|
MutableDoubleSet |
asUnmodifiable() |
|
void |
clear() |
|
<V> MutableSet<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.
|
<V,R extends Collection<V>> |
collect(DoubleToObjectFunction<? extends V> function,
R target) |
Same as
DoubleIterable.collect(DoubleToObjectFunction) , only the results are added to the target Collection. |
void |
compact() |
Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
|
boolean |
contains(double value) |
Returns true if the value is contained in the DoubleIterable, and false if it is not.
|
int |
count(DoublePredicate predicate) |
Returns a count of the number of elements in the DoubleIterable that return true for the
specified predicate.
|
double |
detectIfNone(DoublePredicate predicate,
double ifNone) |
|
MutableDoubleIterator |
doubleIterator() |
Returns a primitive iterator that can be used to iterate over the DoubleIterable in an
imperative style.
|
void |
each(DoubleProcedure procedure) |
A synonym for forEach.
|
void |
forEach(DoubleProcedure procedure) |
Applies the DoubleProcedure to each element in the DoubleIterable.
|
DoubleSet |
freeze() |
Returns a frozen copy of this set.
|
int |
hashCode() |
Follows the same general contract as
Set.hashCode() . |
<T> T |
injectInto(T injectedValue,
ObjectDoubleToObjectFunction<? super T,? extends T> function) |
|
double |
max() |
|
double |
min() |
|
static DoubleHashSet |
newSet(DoubleIterable source) |
|
static DoubleHashSet |
newSetWith(double... source) |
|
boolean |
noneSatisfy(DoublePredicate predicate) |
Returns true if none of the elements in the DoubleIterable return true for the
specified predicate, otherwise returns false.
|
void |
readExternal(ObjectInput in) |
|
DoubleHashSet |
reject(DoublePredicate predicate) |
Returns a new DoubleIterable with all of the elements in the DoubleIterable that
return false for the specified predicate.
|
<R extends MutableDoubleCollection> |
reject(DoublePredicate predicate,
R target) |
Same as
DoubleIterable.reject(DoublePredicate) , only the results are added to the target MutableDoubleCollection. |
boolean |
remove(double value) |
|
boolean |
removeAll(double... source) |
|
boolean |
removeAll(DoubleIterable source) |
|
boolean |
retainAll(double... source) |
|
boolean |
retainAll(DoubleIterable source) |
|
DoubleHashSet |
select(DoublePredicate predicate) |
Returns a new DoubleIterable with all of the elements in the DoubleIterable that
return true for the specified predicate.
|
<R extends MutableDoubleCollection> |
select(DoublePredicate predicate,
R target) |
Same as
DoubleIterable.select(DoublePredicate) , only the results are added to the target MutableDoubleCollection. |
int |
size() |
Returns the number of items in this iterable.
|
double |
sum() |
|
double[] |
toArray() |
Converts the DoubleIterable to a primitive double array.
|
ImmutableDoubleSet |
toImmutable() |
Returns an immutable copy of this set.
|
DoubleHashSet |
with(double element) |
|
DoubleHashSet |
withAll(DoubleIterable elements) |
|
DoubleHashSet |
without(double element) |
|
DoubleHashSet |
withoutAll(DoubleIterable elements) |
|
void |
writeExternal(ObjectOutput out) |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
equals
asLazy, average, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, minIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
public DoubleHashSet()
public DoubleHashSet(int initialCapacity)
public DoubleHashSet(double... elements)
public DoubleHashSet(DoubleHashSet set)
public static DoubleHashSet newSet(DoubleIterable source)
public static DoubleHashSet newSetWith(double... source)
public int hashCode()
DoubleSet
Set.hashCode()
.hashCode
in interface DoubleSet
hashCode
in class AbstractDoubleSet
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public boolean add(double element)
add
in interface MutableDoubleCollection
public boolean addAll(double... source)
addAll
in interface MutableDoubleCollection
public boolean addAll(DoubleIterable source)
addAll
in interface MutableDoubleCollection
public boolean remove(double value)
remove
in interface MutableDoubleCollection
public boolean removeAll(DoubleIterable source)
removeAll
in interface MutableDoubleCollection
public boolean removeAll(double... source)
removeAll
in interface MutableDoubleCollection
public boolean retainAll(DoubleIterable source)
retainAll
in interface MutableDoubleCollection
Collection.retainAll(Collection)
public boolean retainAll(double... source)
retainAll
in interface MutableDoubleCollection
Collection.retainAll(Collection)
public void clear()
clear
in interface MutableDoubleCollection
public DoubleHashSet with(double element)
with
in interface MutableDoubleCollection
with
in interface MutableDoubleSet
public DoubleHashSet without(double element)
without
in interface MutableDoubleCollection
without
in interface MutableDoubleSet
public DoubleHashSet withAll(DoubleIterable elements)
withAll
in interface MutableDoubleCollection
withAll
in interface MutableDoubleSet
public DoubleHashSet withoutAll(DoubleIterable elements)
withoutAll
in interface MutableDoubleCollection
withoutAll
in interface MutableDoubleSet
public MutableDoubleSet asUnmodifiable()
asUnmodifiable
in interface MutableDoubleCollection
asUnmodifiable
in interface MutableDoubleSet
public MutableDoubleSet asSynchronized()
asSynchronized
in interface MutableDoubleCollection
asSynchronized
in interface MutableDoubleSet
public ImmutableDoubleSet toImmutable()
MutableDoubleSet
toImmutable
in interface DoubleSet
toImmutable
in interface MutableDoubleCollection
toImmutable
in interface MutableDoubleSet
public MutableDoubleIterator doubleIterator()
DoubleIterable
doubleIterator
in interface DoubleIterable
doubleIterator
in interface MutableDoubleCollection
public double[] toArray()
DoubleIterable
toArray
in interface DoubleIterable
public boolean contains(double value)
DoubleIterable
contains
in interface DoubleIterable
public void forEach(DoubleProcedure procedure)
DoubleIterable
forEach
in interface DoubleIterable
public void each(DoubleProcedure procedure)
DoubleIterable
each
in interface DoubleIterable
public DoubleHashSet select(DoublePredicate predicate)
DoubleIterable
select
in interface DoubleIterable
select
in interface DoubleSet
select
in interface MutableDoubleCollection
select
in interface MutableDoubleSet
public <R extends MutableDoubleCollection> R select(DoublePredicate predicate, R target)
DoubleIterable
DoubleIterable.select(DoublePredicate)
, only the results are added to the target MutableDoubleCollection.select
in interface DoubleIterable
public DoubleHashSet reject(DoublePredicate predicate)
DoubleIterable
reject
in interface DoubleIterable
reject
in interface DoubleSet
reject
in interface MutableDoubleCollection
reject
in interface MutableDoubleSet
public <R extends MutableDoubleCollection> R reject(DoublePredicate predicate, R target)
DoubleIterable
DoubleIterable.reject(DoublePredicate)
, only the results are added to the target MutableDoubleCollection.reject
in interface DoubleIterable
public <V> MutableSet<V> collect(DoubleToObjectFunction<? extends V> function)
DoubleIterable
collect
in interface DoubleIterable
collect
in interface DoubleSet
collect
in interface MutableDoubleCollection
collect
in interface MutableDoubleSet
public <V,R extends Collection<V>> R collect(DoubleToObjectFunction<? extends V> function, R target)
DoubleIterable
DoubleIterable.collect(DoubleToObjectFunction)
, only the results are added to the target Collection.collect
in interface DoubleIterable
public double detectIfNone(DoublePredicate predicate, double ifNone)
detectIfNone
in interface DoubleIterable
public int count(DoublePredicate predicate)
DoubleIterable
count
in interface DoubleIterable
public boolean anySatisfy(DoublePredicate predicate)
DoubleIterable
anySatisfy
in interface DoubleIterable
public boolean allSatisfy(DoublePredicate predicate)
DoubleIterable
allSatisfy
in interface DoubleIterable
public boolean noneSatisfy(DoublePredicate predicate)
DoubleIterable
noneSatisfy
in interface DoubleIterable
public double sum()
sum
in interface DoubleIterable
public double max()
max
in interface DoubleIterable
public double min()
min
in interface DoubleIterable
public DoubleSet freeze()
MutableDoubleSet
freeze
in interface DoubleSet
freeze
in interface MutableDoubleSet
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
public <T> T injectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T,? extends T> function)
injectInto
in interface DoubleIterable
public void compact()
Copyright © 2004–2017. All rights reserved.