Class IntHashSet
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractIntIterable
-
- org.eclipse.collections.impl.set.primitive.AbstractIntSet
-
- org.eclipse.collections.impl.set.mutable.primitive.IntHashSet
-
- All Implemented Interfaces:
Externalizable,Serializable,MutableIntCollection,IntIterable,PrimitiveIterable,IntSet,MutableIntSet
public class IntHashSet extends AbstractIntSet implements MutableIntSet, Externalizable
This file was automatically generated from template file primitiveHashSet.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntHashSet()IntHashSet(int initialCapacity)IntHashSet(int... elements)IntHashSet(IntIterable elements)IntHashSet(IntHashSet set)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(int element)booleanaddAll(int... source)booleanaddAll(IntIterable source)booleanallSatisfy(IntPredicate predicate)booleananySatisfy(IntPredicate predicate)voidappendString(Appendable appendable, String start, String separator, String end)MutableIntSetasSynchronized()MutableIntSetasUnmodifiable()MutableSet<Integer>boxed()RichIterable<IntIterable>chunk(int size)voidclear()<V> MutableSet<V>collect(IntToObjectFunction<? extends V> function)<V,R extends Collection<V>>
Rcollect(IntToObjectFunction<? extends V> function, R target)voidcompact()Deprecated.since 12.0 - UsetrimToSize()insteadbooleancontains(int value)intcount(IntPredicate predicate)intdetectIfNone(IntPredicate predicate, int ifNone)voideach(IntProcedure procedure)IntSetfreeze()inthashCode()<T> TinjectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)MutableIntIteratorintIterator()intmax()intmin()IntHashSetnewEmpty()Creates a new empty IntHashSet.static IntHashSetnewSet(IntIterable source)static IntHashSetnewSetWith(int... source)voidreadExternal(ObjectInput in)IntHashSetreject(IntPredicate predicate)<R extends MutableIntCollection>
Rreject(IntPredicate predicate, R target)booleanremove(int value)booleanremoveAll(int... source)booleanremoveAll(IntIterable source)booleanretainAll(int... source)booleanretainAll(IntIterable source)IntHashSetselect(IntPredicate predicate)<R extends MutableIntCollection>
Rselect(IntPredicate predicate, R target)intsize()longsum()int[]toArray()int[]toArray(int[] array)ImmutableIntSettoImmutable()booleantrimToSize()IntHashSetwith(int element)IntHashSetwithAll(IntIterable elements)IntHashSetwithout(int element)IntHashSetwithoutAll(IntIterable elements)voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.eclipse.collections.impl.set.primitive.AbstractIntSet
cartesianProduct, equals
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractIntIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.IntIterable
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.IntSet
cartesianProduct, equals, isProperSubsetOf, isSubsetOf, tap
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableIntCollection
removeIf
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.MutableIntSet
difference, intersect, symmetricDifference, tap, union
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
-
-
-
-
Constructor Detail
-
IntHashSet
public IntHashSet()
-
IntHashSet
public IntHashSet(int initialCapacity)
-
IntHashSet
public IntHashSet(int... elements)
-
IntHashSet
public IntHashSet(IntIterable elements)
-
IntHashSet
public IntHashSet(IntHashSet set)
-
-
Method Detail
-
boxed
public MutableSet<Integer> boxed()
- Specified by:
boxedin interfaceMutableIntSet
-
newSet
public static IntHashSet newSet(IntIterable source)
-
newSetWith
public static IntHashSet newSetWith(int... source)
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceIntSet- Specified by:
hashCodein classAbstractIntSet
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
add
public boolean add(int element)
- Specified by:
addin interfaceMutableIntCollection
-
addAll
public boolean addAll(int... source)
- Specified by:
addAllin interfaceMutableIntCollection
-
addAll
public boolean addAll(IntIterable source)
- Specified by:
addAllin interfaceMutableIntCollection
-
remove
public boolean remove(int value)
- Specified by:
removein interfaceMutableIntCollection
-
removeAll
public boolean removeAll(IntIterable source)
- Specified by:
removeAllin interfaceMutableIntCollection
-
removeAll
public boolean removeAll(int... source)
- Specified by:
removeAllin interfaceMutableIntCollection
-
retainAll
public boolean retainAll(IntIterable source)
- Specified by:
retainAllin interfaceMutableIntCollection
-
retainAll
public boolean retainAll(int... source)
- Specified by:
retainAllin interfaceMutableIntCollection
-
clear
public void clear()
- Specified by:
clearin interfaceMutableIntCollection
-
with
public IntHashSet with(int element)
- Specified by:
within interfaceMutableIntCollection- Specified by:
within interfaceMutableIntSet
-
without
public IntHashSet without(int element)
- Specified by:
withoutin interfaceMutableIntCollection- Specified by:
withoutin interfaceMutableIntSet
-
withAll
public IntHashSet withAll(IntIterable elements)
- Specified by:
withAllin interfaceMutableIntCollection- Specified by:
withAllin interfaceMutableIntSet
-
withoutAll
public IntHashSet withoutAll(IntIterable elements)
- Specified by:
withoutAllin interfaceMutableIntCollection- Specified by:
withoutAllin interfaceMutableIntSet
-
asUnmodifiable
public MutableIntSet asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableIntCollection- Specified by:
asUnmodifiablein interfaceMutableIntSet
-
asSynchronized
public MutableIntSet asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableIntCollection- Specified by:
asSynchronizedin interfaceMutableIntSet
-
toImmutable
public ImmutableIntSet toImmutable()
- Specified by:
toImmutablein interfaceIntSet- Specified by:
toImmutablein interfaceMutableIntCollection- Specified by:
toImmutablein interfaceMutableIntSet
-
intIterator
public MutableIntIterator intIterator()
- Specified by:
intIteratorin interfaceIntIterable- Specified by:
intIteratorin interfaceMutableIntCollection
-
toArray
public int[] toArray()
- Specified by:
toArrayin interfaceIntIterable
-
toArray
public int[] toArray(int[] array)
- Specified by:
toArrayin interfaceIntIterable
-
contains
public boolean contains(int value)
- Specified by:
containsin interfaceIntIterable
-
each
public void each(IntProcedure procedure)
- Specified by:
eachin interfaceIntIterable- Since:
- 7.0.
-
select
public IntHashSet select(IntPredicate predicate)
- Specified by:
selectin interfaceIntIterable- Specified by:
selectin interfaceIntSet- Specified by:
selectin interfaceMutableIntCollection- Specified by:
selectin interfaceMutableIntSet
-
select
public <R extends MutableIntCollection> R select(IntPredicate predicate, R target)
- Specified by:
selectin interfaceIntIterable- Since:
- 8.1.
-
reject
public IntHashSet reject(IntPredicate predicate)
- Specified by:
rejectin interfaceIntIterable- Specified by:
rejectin interfaceIntSet- Specified by:
rejectin interfaceMutableIntCollection- Specified by:
rejectin interfaceMutableIntSet
-
reject
public <R extends MutableIntCollection> R reject(IntPredicate predicate, R target)
- Specified by:
rejectin interfaceIntIterable- Since:
- 8.1.
-
collect
public <V> MutableSet<V> collect(IntToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceIntIterable- Specified by:
collectin interfaceIntSet- Specified by:
collectin interfaceMutableIntCollection- Specified by:
collectin interfaceMutableIntSet
-
collect
public <V,R extends Collection<V>> R collect(IntToObjectFunction<? extends V> function, R target)
- Specified by:
collectin interfaceIntIterable- Since:
- 8.1.
-
detectIfNone
public int detectIfNone(IntPredicate predicate, int ifNone)
- Specified by:
detectIfNonein interfaceIntIterable
-
count
public int count(IntPredicate predicate)
- Specified by:
countin interfaceIntIterable
-
anySatisfy
public boolean anySatisfy(IntPredicate predicate)
- Specified by:
anySatisfyin interfaceIntIterable
-
allSatisfy
public boolean allSatisfy(IntPredicate predicate)
- Specified by:
allSatisfyin interfaceIntIterable
-
sum
public long sum()
- Specified by:
sumin interfaceIntIterable
-
max
public int max()
- Specified by:
maxin interfaceIntIterable
-
min
public int min()
- Specified by:
minin interfaceIntIterable
-
freeze
public IntSet freeze()
- Specified by:
freezein interfaceIntSet- Specified by:
freezein interfaceMutableIntSet
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
injectInto
public <T> T injectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceIntIterable
-
chunk
public RichIterable<IntIterable> chunk(int size)
- Specified by:
chunkin interfaceIntIterable
-
newEmpty
public IntHashSet newEmpty()
Creates a new empty IntHashSet.- Specified by:
newEmptyin interfaceMutableIntCollection- Specified by:
newEmptyin interfaceMutableIntSet- Since:
- 9.2.
-
trimToSize
public boolean trimToSize()
- Since:
- 12.0
-
compact
@Deprecated public void compact()
Deprecated.since 12.0 - UsetrimToSize()insteadRehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
-
-