Top Fields Constructors Methods
org.eclipse.collections.impl.set.strategy.immutable

pack-priv final Class ImmutableUnifiedSetWithHashingStrategy<T>

extends AbstractImmutableSet<T>
implements Serializable, BatchIterable<T>
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.impl.parallel.BatchIterable, java.io.Serializable
Imports
java.io.Serializable, java.util.Iterator, java.util.concurrent.ExecutorService, org.eclipse.collections.api.block.HashingStrategy, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.set.ImmutableSet, .ParallelUnsortedSetIterable, org.eclipse.collections.impl.UnmodifiableIteratorAdapter, org.eclipse.collections.impl.parallel.BatchIterable, org.eclipse.collections.impl.set.immutable.AbstractImmutableSet, org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy

Field Summary

Modifier and TypeField and Description
private final UnifiedSetWithHashingStrategy<T>
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ParallelUnsortedSetIterable<T>
public void
batchForEach(Procedure<? super T> procedure, int sectionIndex, int sectionCount)

Implements org.eclipse.collections.impl.parallel.BatchIterable.batchForEach.

public boolean
public void
each(Procedure<? super T> procedure)

Implements org.eclipse.collections.api.RichIterable.each.

The procedure is executed for each element in the iterable.

public boolean
equals(Object other)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.set.SetIterable.equals, java.util.Set.equals, java.util.Collection.equals.

Compares the specified object with this set for equality.

public int
public T
getFirst()

Implements org.eclipse.collections.api.RichIterable.getFirst.

Returns the first element of an iterable.

public T
getLast()

Implements org.eclipse.collections.api.RichIterable.getLast.

Returns the last element of an iterable.

public T
getOnly()

Overrides default org.eclipse.collections.api.RichIterable.getOnly.

Returns the element if the iterable has exactly one element.

public int
public Iterator<T>
iterator()

Implements java.lang.Iterable.iterator, java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.

public static <T> ImmutableSet<T>
newSet(HashingStrategy<? super T> hashingStrategy, Iterable<? extends T> iterable)

public static <T> ImmutableSet<T>
newSet(HashingStrategy<? super T> hashingStrategy, int capacity)

public static <T> ImmutableSet<T>
newSetWith(HashingStrategy<? super T> hashingStrategy, T... elements)

public int
private Object
Inherited from org.eclipse.collections.impl.set.immutable.AbstractImmutableSet:
cartesianProductcastToSetcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithdifferencedifferenceIntoflatCollectgroupBygroupBygroupByEachgroupByEachintersectintersectIntoisProperSubsetOfisSubsetOfnewMutablenewWithnewWithAllnewWithoutnewWithoutAllnullSafeHashCodepartitionpartitionWithpowerSetrejectrejectWithselectselectInstancesOfselectWithsymmetricDifferencesymmetricDifferenceIntotaptoImmutableunionunionIntozipzipWithIndex

Field Detail

delegateback to summary
private final UnifiedSetWithHashingStrategy<T> delegate
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ImmutableUnifiedSetWithHashingStrategyback to summary
private ImmutableUnifiedSetWithHashingStrategy(UnifiedSetWithHashingStrategy<T> delegate)

Method Detail

asParallelback to summary
public ParallelUnsortedSetIterable<T> asParallel(ExecutorService executorService, int batchSize)

Overrides org.eclipse.collections.impl.set.immutable.AbstractImmutableSet.asParallel.

Implements org.eclipse.collections.api.set.UnsortedSetIterable.asParallel, org.eclipse.collections.api.set.SetIterable.asParallel.

Doc from org.eclipse.collections.api.set.SetIterable.asParallel.

Returns a parallel iterable of this SetIterable.

Annotations
@Override
batchForEachback to summary
public void batchForEach(Procedure<? super T> procedure, int sectionIndex, int sectionCount)

Implements org.eclipse.collections.impl.parallel.BatchIterable.batchForEach.

Annotations
@Override
containsback to summary
public boolean contains(Object object)

Overrides org.eclipse.collections.impl.AbstractRichIterable.contains.

Implements org.eclipse.collections.api.RichIterable.contains, java.util.Set.contains, java.util.Collection.contains.

Doc from java.util.Set.contains.

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that Objects.equals(o, e).

Annotations
@Override
eachback to summary
public void each(Procedure<? super T> procedure)

Implements org.eclipse.collections.api.RichIterable.each.

Doc from org.eclipse.collections.api.RichIterable.each.

The procedure is executed for each element in the iterable.

Example using a Java 8 lambda expression:

people.each(person -> LOGGER.info(person.getName()));
This method is a variant of InternalIterable#forEach(Procedure) that has a signature conflict with Iterable#forEach(java.util.function.Consumer).
Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.set.SetIterable.equals, java.util.Set.equals, java.util.Collection.equals.

Doc from java.util.Set.equals.

Compares the specified object with this set for equality. Returns true if the specified object is also a set, the two sets have the same size, and every member of the specified set is contained in this set (or equivalently, every member of this set is contained in the specified set). This definition ensures that the equals method works properly across different implementations of the set interface.

Annotations
@Override
getBatchCountback to summary
public int getBatchCount(int batchSize)

Implements org.eclipse.collections.impl.parallel.BatchIterable.getBatchCount.

Annotations
@Override
getFirstback to summary
public T getFirst()

Implements org.eclipse.collections.api.RichIterable.getFirst.

Doc from org.eclipse.collections.api.RichIterable.getFirst.

Returns the first element of an iterable. In the case of a List it is the element at the first index. In the case of any other Collection, it is the first element that would be returned during an iteration. If the iterable is empty, null is returned. If null is a valid element of the container, then a developer would need to check to see if the iterable is empty to validate that a null result was not due to the container being empty.

The order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the first element could be any element from the Set.

Annotations
@Override
getLastback to summary
public T getLast()

Implements org.eclipse.collections.api.RichIterable.getLast.

Doc from org.eclipse.collections.api.RichIterable.getLast.

Returns the last element of an iterable. In the case of a List it is the element at the last index. In the case of any other Collection, it is the last element that would be returned during an iteration. If the iterable is empty, null is returned. If null is a valid element of the container, then a developer would need to check to see if the iterable is empty to validate that a null result was not due to the container being empty.

The order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the last element could be any element from the Set.

Annotations
@Override
getOnlyback to summary
public T getOnly()

Overrides default org.eclipse.collections.api.RichIterable.getOnly.

Doc from org.eclipse.collections.api.RichIterable.getOnly.

Returns the element if the iterable has exactly one element. Otherwise, throw IllegalStateException.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.eclipse.collections.api.set.SetIterable.hashCode, java.util.Set.hashCode, java.util.Collection.hashCode.

Doc from java.util.Set.hashCode.

Returns the hash code value for this set. The hash code of a set is defined to be the sum of the hash codes of the elements in the set, where the hash code of a null element is defined to be zero. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two sets s1 and s2, as required by the general contract of Object#hashCode.

Annotations
@Override
iteratorback to summary
public Iterator<T> iterator()

Implements java.lang.Iterable.iterator, java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Annotations
@Override
newSetback to summary
public static <T> ImmutableSet<T> newSet(HashingStrategy<? super T> hashingStrategy, Iterable<? extends T> iterable)
newSetback to summary
public static <T> ImmutableSet<T> newSet(HashingStrategy<? super T> hashingStrategy, int capacity)
newSetWithback to summary
public static <T> ImmutableSet<T> newSetWith(HashingStrategy<? super T> hashingStrategy, T... elements)
sizeback to summary
public int size()

Implements org.eclipse.collections.impl.parallel.BatchIterable.size, org.eclipse.collections.api.RichIterable.size, java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Annotations
@Override
writeReplaceback to summary
private Object writeReplace()