@Override ImmutableSet<E> build() { switch (distinct) { case 0: return of(); case 1: return of(dedupedElements[0]); default: Object[] elements = (distinct == dedupedElements.length) ? dedupedElements : Arrays.copyOf(dedupedElements, distinct); return new RegularImmutableSet<E>(elements, hashCode, hashTable, hashTable.length - 1); } } }
@Override public UnmodifiableIterator<E> iterator() { return asList().iterator(); }
@Override ImmutableSet<E> build() { switch (distinct) { case 0: return of(); case 1: return of(dedupedElements[0]); default: Object[] elements = (distinct == dedupedElements.length) ? dedupedElements : Arrays.copyOf(dedupedElements, distinct); return new RegularImmutableSet<E>(elements, hashCode, hashTable, hashTable.length - 1); } } }
@Override ImmutableSet<E> build() { switch (distinct) { case 0: return of(); case 1: return of(dedupedElements[0]); default: Object[] elements = (distinct == dedupedElements.length) ? dedupedElements : Arrays.copyOf(dedupedElements, distinct); return new RegularImmutableSet<E>(elements, hashCode, hashTable, hashTable.length - 1); } } }
@Override ImmutableSet<E> build() { switch (distinct) { case 0: return of(); case 1: return of(dedupedElements[0]); default: Object[] elements = (distinct == dedupedElements.length) ? dedupedElements : Arrays.copyOf(dedupedElements, distinct); return new RegularImmutableSet<E>(elements, hashCode, hashTable, hashTable.length - 1); } } }
return new RegularImmutableSet<E>( elements.toArray(), hashCode, table, mask);
return new RegularImmutableSet<E>( elements.toArray(), hashCode, table, mask);
return new RegularImmutableSet<E>( elements.toArray(), hashCode, table, mask);
return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);
return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);
? ObjectArrays.arraysCopyOf(elements, uniques) : elements; return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);
? ObjectArrays.arraysCopyOf(elements, uniques) : elements; return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);
? ObjectArrays.arraysCopyOf(elements, uniques) : elements; return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);
? ObjectArrays.arraysCopyOf(elements, uniques) : elements; return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);
? ObjectArrays.arraysCopyOf(elements, uniques) : elements; return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);
? ObjectArrays.arraysCopyOf(elements, uniques) : elements; return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);
? ObjectArrays.arraysCopyOf(elements, uniques) : elements; return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);
? ObjectArrays.arraysCopyOf(elements, uniques) : elements; return new RegularImmutableSet<E>(uniqueElements, hashCode, table, mask);