java.io.Externalizable, java.io.Serializable, MutableLongCollection, LongIterable, PrimitiveIterable, LongSet, MutableLongSetpublic class LongHashSet extends AbstractLongSet implements MutableLongSet, java.io.Externalizable
| Constructor | Description |
|---|---|
LongHashSet() |
|
LongHashSet(int initialCapacity) |
|
LongHashSet(long... elements) |
|
LongHashSet(LongHashSet set) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(long element) |
|
boolean |
addAll(long... source) |
|
boolean |
addAll(LongIterable source) |
|
boolean |
allSatisfy(LongPredicate predicate) |
Returns true if all of the elements in the LongIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(LongPredicate predicate) |
Returns true if any of the elements in the LongIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end) |
Prints a string representation of this collection onto the given
Appendable. |
MutableLongSet |
asSynchronized() |
|
MutableLongSet |
asUnmodifiable() |
|
RichIterable<LongIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<V> MutableSet<V> |
collect(LongToObjectFunction<? 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 java.util.Collection<V>> |
collect(LongToObjectFunction<? extends V> function,
R target) |
Same as
LongIterable.collect(LongToObjectFunction) , 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(long value) |
Returns true if the value is contained in the LongIterable, and false if it is not.
|
int |
count(LongPredicate predicate) |
Returns a count of the number of elements in the LongIterable that return true for the
specified predicate.
|
long |
detectIfNone(LongPredicate predicate,
long ifNone) |
|
void |
each(LongProcedure procedure) |
A synonym for forEach.
|
void |
forEach(LongProcedure procedure) |
Applies the LongProcedure to each element in the LongIterable.
|
LongSet |
freeze() |
Returns a frozen copy of this set.
|
int |
hashCode() |
Follows the same general contract as
Set.hashCode(). |
<T> T |
injectInto(T injectedValue,
ObjectLongToObjectFunction<? super T,? extends T> function) |
|
MutableLongIterator |
longIterator() |
Returns a primitive iterator that can be used to iterate over the LongIterable in an
imperative style.
|
long |
max() |
|
long |
min() |
|
LongHashSet |
newEmpty() |
Creates a new empty LongHashSet.
|
static LongHashSet |
newSet(LongIterable source) |
|
static LongHashSet |
newSetWith(long... source) |
|
boolean |
noneSatisfy(LongPredicate predicate) |
Returns true if none of the elements in the LongIterable return true for the
specified predicate, otherwise returns false.
|
void |
readExternal(java.io.ObjectInput in) |
|
LongHashSet |
reject(LongPredicate predicate) |
Returns a new LongIterable with all of the elements in the LongIterable that
return false for the specified predicate.
|
<R extends MutableLongCollection> |
reject(LongPredicate predicate,
R target) |
Same as
LongIterable.reject(LongPredicate) , only the results are added to the target MutableLongCollection. |
boolean |
remove(long value) |
|
boolean |
removeAll(long... source) |
|
boolean |
removeAll(LongIterable source) |
|
boolean |
retainAll(long... source) |
|
boolean |
retainAll(LongIterable source) |
|
LongHashSet |
select(LongPredicate predicate) |
Returns a new LongIterable with all of the elements in the LongIterable that
return true for the specified predicate.
|
<R extends MutableLongCollection> |
select(LongPredicate predicate,
R target) |
Same as
LongIterable.select(LongPredicate) , only the results are added to the target MutableLongCollection. |
int |
size() |
Returns the number of items in this iterable.
|
long |
sum() |
|
long[] |
toArray() |
Converts the LongIterable to a primitive long array.
|
ImmutableLongSet |
toImmutable() |
Returns an immutable copy of this set.
|
LongHashSet |
with(long element) |
|
LongHashSet |
withAll(LongIterable elements) |
|
LongHashSet |
without(long element) |
|
LongHashSet |
withoutAll(LongIterable elements) |
|
void |
writeExternal(java.io.ObjectOutput out) |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringequalsasLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedListremoveIftapappendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toStringpublic LongHashSet()
public LongHashSet(int initialCapacity)
public LongHashSet(long... elements)
public LongHashSet(LongHashSet set)
public static LongHashSet newSet(LongIterable source)
public static LongHashSet newSetWith(long... source)
public int hashCode()
LongSetSet.hashCode().hashCode in interface LongSethashCode in class AbstractLongSetpublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic void appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic boolean add(long element)
add in interface MutableLongCollectionpublic boolean addAll(long... source)
addAll in interface MutableLongCollectionpublic boolean addAll(LongIterable source)
addAll in interface MutableLongCollectionpublic boolean remove(long value)
remove in interface MutableLongCollectionpublic boolean removeAll(LongIterable source)
removeAll in interface MutableLongCollectionpublic boolean removeAll(long... source)
removeAll in interface MutableLongCollectionpublic boolean retainAll(LongIterable source)
retainAll in interface MutableLongCollectionCollection.retainAll(Collection)public boolean retainAll(long... source)
retainAll in interface MutableLongCollectionCollection.retainAll(Collection)public void clear()
clear in interface MutableLongCollectionpublic LongHashSet with(long element)
with in interface MutableLongCollectionwith in interface MutableLongSetpublic LongHashSet without(long element)
without in interface MutableLongCollectionwithout in interface MutableLongSetpublic LongHashSet withAll(LongIterable elements)
withAll in interface MutableLongCollectionwithAll in interface MutableLongSetpublic LongHashSet withoutAll(LongIterable elements)
withoutAll in interface MutableLongCollectionwithoutAll in interface MutableLongSetpublic MutableLongSet asUnmodifiable()
asUnmodifiable in interface MutableLongCollectionasUnmodifiable in interface MutableLongSetpublic MutableLongSet asSynchronized()
asSynchronized in interface MutableLongCollectionasSynchronized in interface MutableLongSetpublic ImmutableLongSet toImmutable()
MutableLongSettoImmutable in interface LongSettoImmutable in interface MutableLongCollectiontoImmutable in interface MutableLongSetpublic MutableLongIterator longIterator()
LongIterablelongIterator in interface LongIterablelongIterator in interface MutableLongCollectionpublic long[] toArray()
LongIterabletoArray in interface LongIterablepublic boolean contains(long value)
LongIterablecontains in interface LongIterablepublic void forEach(LongProcedure procedure)
LongIterableforEach in interface LongIterablepublic void each(LongProcedure procedure)
LongIterableeach in interface LongIterablepublic LongHashSet select(LongPredicate predicate)
LongIterableselect in interface LongIterableselect in interface LongSetselect in interface MutableLongCollectionselect in interface MutableLongSetpublic <R extends MutableLongCollection> R select(LongPredicate predicate, R target)
LongIterableLongIterable.select(LongPredicate) , only the results are added to the target MutableLongCollection.select in interface LongIterablepublic LongHashSet reject(LongPredicate predicate)
LongIterablereject in interface LongIterablereject in interface LongSetreject in interface MutableLongCollectionreject in interface MutableLongSetpublic <R extends MutableLongCollection> R reject(LongPredicate predicate, R target)
LongIterableLongIterable.reject(LongPredicate) , only the results are added to the target MutableLongCollection.reject in interface LongIterablepublic <V> MutableSet<V> collect(LongToObjectFunction<? extends V> function)
LongIterablecollect in interface LongIterablecollect in interface LongSetcollect in interface MutableLongCollectioncollect in interface MutableLongSetpublic <V,R extends java.util.Collection<V>> R collect(LongToObjectFunction<? extends V> function, R target)
LongIterableLongIterable.collect(LongToObjectFunction) , only the results are added to the target Collection.collect in interface LongIterablepublic long detectIfNone(LongPredicate predicate, long ifNone)
detectIfNone in interface LongIterablepublic int count(LongPredicate predicate)
LongIterablecount in interface LongIterablepublic boolean anySatisfy(LongPredicate predicate)
LongIterableanySatisfy in interface LongIterablepublic boolean allSatisfy(LongPredicate predicate)
LongIterableallSatisfy in interface LongIterablepublic boolean noneSatisfy(LongPredicate predicate)
LongIterablenoneSatisfy in interface LongIterablepublic long sum()
sum in interface LongIterablepublic long max()
max in interface LongIterablepublic long min()
min in interface LongIterablepublic LongSet freeze()
MutableLongSetfreeze in interface LongSetfreeze in interface MutableLongSetpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException
readExternal in interface java.io.Externalizablejava.io.IOExceptionpublic <T> T injectInto(T injectedValue,
ObjectLongToObjectFunction<? super T,? extends T> function)
injectInto in interface LongIterablepublic RichIterable<LongIterable> chunk(int size)
LongIterablechunk in interface LongIterablesize - the number of elements per chunkRichIterable containing LongIterables of size size, except the last will be
truncated if the elements don't divide evenly.public LongHashSet newEmpty()
newEmpty in interface MutableLongCollectionnewEmpty in interface MutableLongSetpublic void compact()
Copyright © 2004–2020. All rights reserved.