Externalizable, Serializable, MutableIntCollection, IntIterable, PrimitiveIterable, IntSet, MutableIntSetpublic class IntHashSet extends AbstractIntSet implements MutableIntSet, Externalizable
| Constructor | Description |
|---|---|
IntHashSet() |
|
IntHashSet(int initialCapacity) |
|
IntHashSet(int... elements) |
|
IntHashSet(IntHashSet set) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(int element) |
|
boolean |
addAll(int... source) |
|
boolean |
addAll(IntIterable source) |
|
boolean |
allSatisfy(IntPredicate predicate) |
Returns true if all of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(IntPredicate predicate) |
Returns true if any of the elements in the IntIterable 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. |
MutableIntSet |
asSynchronized() |
|
MutableIntSet |
asUnmodifiable() |
|
RichIterable<IntIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<V> MutableSet<V> |
collect(IntToObjectFunction<? 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(IntToObjectFunction<? extends V> function,
R target) |
Same as
IntIterable.collect(IntToObjectFunction) , 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(int value) |
Returns true if the value is contained in the IntIterable, and false if it is not.
|
int |
count(IntPredicate predicate) |
Returns a count of the number of elements in the IntIterable that return true for the
specified predicate.
|
int |
detectIfNone(IntPredicate predicate,
int ifNone) |
|
void |
each(IntProcedure procedure) |
A synonym for forEach.
|
void |
forEach(IntProcedure procedure) |
Applies the IntProcedure to each element in the IntIterable.
|
IntSet |
freeze() |
Returns a frozen copy of this set.
|
int |
hashCode() |
Follows the same general contract as
Set.hashCode(). |
<T> T |
injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function) |
|
MutableIntIterator |
intIterator() |
Returns a primitive iterator that can be used to iterate over the IntIterable in an
imperative style.
|
int |
max() |
|
int |
min() |
|
IntHashSet |
newEmpty() |
Creates a new empty IntHashSet.
|
static IntHashSet |
newSet(IntIterable source) |
|
static IntHashSet |
newSetWith(int... source) |
|
boolean |
noneSatisfy(IntPredicate predicate) |
Returns true if none of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
void |
readExternal(ObjectInput in) |
|
IntHashSet |
reject(IntPredicate predicate) |
Returns a new IntIterable with all of the elements in the IntIterable that
return false for the specified predicate.
|
<R extends MutableIntCollection> |
reject(IntPredicate predicate,
R target) |
Same as
IntIterable.reject(IntPredicate) , only the results are added to the target MutableIntCollection. |
boolean |
remove(int value) |
|
boolean |
removeAll(int... source) |
|
boolean |
removeAll(IntIterable source) |
|
boolean |
retainAll(int... source) |
|
boolean |
retainAll(IntIterable source) |
|
IntHashSet |
select(IntPredicate predicate) |
Returns a new IntIterable with all of the elements in the IntIterable that
return true for the specified predicate.
|
<R extends MutableIntCollection> |
select(IntPredicate predicate,
R target) |
Same as
IntIterable.select(IntPredicate) , only the results are added to the target MutableIntCollection. |
int |
size() |
Returns the number of items in this iterable.
|
long |
sum() |
|
int[] |
toArray() |
Converts the IntIterable to a primitive int array.
|
ImmutableIntSet |
toImmutable() |
Returns an immutable copy of this set.
|
IntHashSet |
with(int element) |
|
IntHashSet |
withAll(IntIterable elements) |
|
IntHashSet |
without(int element) |
|
IntHashSet |
withoutAll(IntIterable elements) |
|
void |
writeExternal(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 IntHashSet()
public IntHashSet(int initialCapacity)
public IntHashSet(int... elements)
public IntHashSet(IntHashSet set)
public static IntHashSet newSet(IntIterable source)
public static IntHashSet newSetWith(int... source)
public int hashCode()
IntSetSet.hashCode().hashCode in interface IntSethashCode in class AbstractIntSetpublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic 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 boolean add(int element)
add in interface MutableIntCollectionpublic boolean addAll(int... source)
addAll in interface MutableIntCollectionpublic boolean addAll(IntIterable source)
addAll in interface MutableIntCollectionpublic boolean remove(int value)
remove in interface MutableIntCollectionpublic boolean removeAll(IntIterable source)
removeAll in interface MutableIntCollectionpublic boolean removeAll(int... source)
removeAll in interface MutableIntCollectionpublic boolean retainAll(IntIterable source)
retainAll in interface MutableIntCollectionCollection.retainAll(Collection)public boolean retainAll(int... source)
retainAll in interface MutableIntCollectionCollection.retainAll(Collection)public void clear()
clear in interface MutableIntCollectionpublic IntHashSet with(int element)
with in interface MutableIntCollectionwith in interface MutableIntSetpublic IntHashSet without(int element)
without in interface MutableIntCollectionwithout in interface MutableIntSetpublic IntHashSet withAll(IntIterable elements)
withAll in interface MutableIntCollectionwithAll in interface MutableIntSetpublic IntHashSet withoutAll(IntIterable elements)
withoutAll in interface MutableIntCollectionwithoutAll in interface MutableIntSetpublic MutableIntSet asUnmodifiable()
asUnmodifiable in interface MutableIntCollectionasUnmodifiable in interface MutableIntSetpublic MutableIntSet asSynchronized()
asSynchronized in interface MutableIntCollectionasSynchronized in interface MutableIntSetpublic ImmutableIntSet toImmutable()
MutableIntSettoImmutable in interface IntSettoImmutable in interface MutableIntCollectiontoImmutable in interface MutableIntSetpublic MutableIntIterator intIterator()
IntIterableintIterator in interface IntIterableintIterator in interface MutableIntCollectionpublic int[] toArray()
IntIterabletoArray in interface IntIterablepublic boolean contains(int value)
IntIterablecontains in interface IntIterablepublic void forEach(IntProcedure procedure)
IntIterableforEach in interface IntIterablepublic void each(IntProcedure procedure)
IntIterableeach in interface IntIterablepublic IntHashSet select(IntPredicate predicate)
IntIterableselect in interface IntIterableselect in interface IntSetselect in interface MutableIntCollectionselect in interface MutableIntSetpublic <R extends MutableIntCollection> R select(IntPredicate predicate, R target)
IntIterableIntIterable.select(IntPredicate) , only the results are added to the target MutableIntCollection.select in interface IntIterablepublic IntHashSet reject(IntPredicate predicate)
IntIterablereject in interface IntIterablereject in interface IntSetreject in interface MutableIntCollectionreject in interface MutableIntSetpublic <R extends MutableIntCollection> R reject(IntPredicate predicate, R target)
IntIterableIntIterable.reject(IntPredicate) , only the results are added to the target MutableIntCollection.reject in interface IntIterablepublic <V> MutableSet<V> collect(IntToObjectFunction<? extends V> function)
IntIterablecollect in interface IntIterablecollect in interface IntSetcollect in interface MutableIntCollectioncollect in interface MutableIntSetpublic <V,R extends Collection<V>> R collect(IntToObjectFunction<? extends V> function, R target)
IntIterableIntIterable.collect(IntToObjectFunction) , only the results are added to the target Collection.collect in interface IntIterablepublic int detectIfNone(IntPredicate predicate, int ifNone)
detectIfNone in interface IntIterablepublic int count(IntPredicate predicate)
IntIterablecount in interface IntIterablepublic boolean anySatisfy(IntPredicate predicate)
IntIterableanySatisfy in interface IntIterablepublic boolean allSatisfy(IntPredicate predicate)
IntIterableallSatisfy in interface IntIterablepublic boolean noneSatisfy(IntPredicate predicate)
IntIterablenoneSatisfy in interface IntIterablepublic long sum()
sum in interface IntIterablepublic int max()
max in interface IntIterablepublic int min()
min in interface IntIterablepublic IntSet freeze()
MutableIntSetfreeze in interface IntSetfreeze in interface MutableIntSetpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionpublic <T> T injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function)
injectInto in interface IntIterablepublic RichIterable<IntIterable> chunk(int size)
IntIterablechunk in interface IntIterablesize - the number of elements per chunkRichIterable containing IntIterables of size size, except the last will be
truncated if the elements don't divide evenly.public IntHashSet newEmpty()
newEmpty in interface MutableIntCollectionnewEmpty in interface MutableIntSetpublic void compact()
Copyright © 2004–2019. All rights reserved.