net.openhft.koloboke.collect.set.ObjSetFactory Maven / Gradle / Ivy
Show all versions of koloboke-api-jdk8 Show documentation
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.openhft.koloboke.collect.set;
import net.openhft.koloboke.collect.ContainerFactory;
import net.openhft.koloboke.collect.Equivalence;
import java.util.function.Consumer;
import javax.annotation.Nonnull;
import java.util.Iterator;
/**
* An immutable factory of {@code ObjSet}s.
*
* @param the most general element type of the sets that could be constructed
* by this factory
* @param the concrete factory type which extends this interface
* @see ObjSet
*/
public interface ObjSetFactory> extends ContainerFactory {
/**
* Returns the equivalence to which {@linkplain ObjSet#equivalence() equivalence} of the sets
* constructed by this factory is set.
*
* @return the key equivalence of the maps constructed by this factory
*/
@Nonnull
Equivalence getEquivalence();
/**
* Constructs a new empty mutable set of the {@linkplain #getDefaultExpectedSize() default
* expected size}.
*
* @param the element type of the returned set
* @return a new empty mutable set
*/
@Nonnull
ObjSet newMutableSet();
/**
* Constructs a new empty mutable set of the given expected size.
*
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new empty mutable set of the given expected size
*/
@Nonnull
ObjSet newMutableSet(int expectedSize);
/**
* Constructs a new mutable set containing the elements in the specified iterable.
*
*
* If the specified iterable is an instance of {@code ObjSet} and has the same {@linkplain
* ObjSet#equivalence() equivalence} with this factory (and thus the constructed set),
* the {@code expectedSize} argument is ignored.
*
*
* @param elements the iterable whose elements are to be placed into the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new mutable set of the elements of the specified iterable
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterable elements, int expectedSize);
/**
* Constructs a new mutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new mutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2, int expectedSize);
/**
* Constructs a new mutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new mutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3, int expectedSize);
/**
* Constructs a new mutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new mutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4, int expectedSize);
/**
* Constructs a new mutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
* @param elems5 the fifth source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new mutable set which merge the elements of the specified iterables
*/
ObjSet newMutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4,
@Nonnull Iterable elems5, int expectedSize);
/**
* Constructs a new mutable set containing the elements traversed by the specified iterator.
*
* @param elements the iterator from which elements are to be placed into the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new mutable set containing the elements traversed by the specified iterator
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterator elements, int expectedSize);
/**
* Constructs a new mutable set of elements consumed by the callback within the given closure.
*
* Example: TODO
*
* @param elementsSupplier the function which supply mappings for the returned set via
* the callback passed in
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new mutable set of elements consumed by the callback within the given closure
*/
@Nonnull
ObjSet newMutableSet(@Nonnull
Consumer> elementsSupplier
, int expectedSize);
/**
* Constructs a new mutable set of elements from the given array.
*
* @param elements the array whose elements are to be placed into the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new mutable set of elements from the given array
*/
@Nonnull
ObjSet newMutableSet(@Nonnull E2[] elements, int expectedSize);
/**
* Constructs a new mutable set containing the elements in the specified iterable.
*
*
*
* @param elements the iterable whose elements are to be placed into the returned set
*
* @param the element type of the returned set
* @return a new mutable set of the elements of the specified iterable
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterable elements);
/**
* Constructs a new mutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
*
* @param the element type of the returned set
* @return a new mutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2);
/**
* Constructs a new mutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
*
* @param the element type of the returned set
* @return a new mutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3);
/**
* Constructs a new mutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
*
* @param the element type of the returned set
* @return a new mutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4);
/**
* Constructs a new mutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
* @param elems5 the fifth source of elements for the returned set
*
* @param the element type of the returned set
* @return a new mutable set which merge the elements of the specified iterables
*/
ObjSet newMutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4,
@Nonnull Iterable elems5);
/**
* Constructs a new mutable set containing the elements traversed by the specified iterator.
*
* @param elements the iterator from which elements are to be placed into the returned set
*
* @param the element type of the returned set
* @return a new mutable set containing the elements traversed by the specified iterator
*/
@Nonnull
ObjSet newMutableSet(@Nonnull Iterator elements);
/**
* Constructs a new mutable set of elements consumed by the callback within the given closure.
*
* Example: TODO
*
* @param elementsSupplier the function which supply mappings for the returned set via
* the callback passed in
*
* @param the element type of the returned set
* @return a new mutable set of elements consumed by the callback within the given closure
*/
@Nonnull
ObjSet newMutableSet(@Nonnull
Consumer> elementsSupplier
);
/**
* Constructs a new mutable set of elements from the given array.
*
* @param elements the array whose elements are to be placed into the returned set
*
* @param the element type of the returned set
* @return a new mutable set of elements from the given array
*/
@Nonnull
ObjSet newMutableSet(@Nonnull E2[] elements);
/**
* Constructs a new mutable singleton set of the given element.
*
* @param e1 the sole element
* @param the element type of the returned set
* @return a new mutable singleton set of the given element
*/
@Nonnull
ObjSet newMutableSetOf(E2 e1);
/**
* Constructs a new mutable set of the two specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param the element type of the returned set
* @return a new mutable set of the two specified elements
*/
@Nonnull
ObjSet newMutableSetOf(E2 e1, E2 e2);
/**
* Constructs a new mutable set of the three specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @param the element type of the returned set
* @return a new mutable set of the three specified elements
*/
@Nonnull
ObjSet newMutableSetOf(E2 e1, E2 e2, E2 e3);
/**
* Constructs a new mutable set of the four specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @param e4 the fourth element
* @param the element type of the returned set
* @return a new mutable set of the four specified elements
*/
@Nonnull
ObjSet newMutableSetOf(E2 e1, E2 e2, E2 e3,
E2 e4);
/**
* Constructs a new mutable set of the specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @param e4 the fourth element
* @param e5 the fifth element
* @param restElements the rest elements to be placed into the set
* @param the element type of the returned set
* @return a new mutable set of the specified elements
*/
@Nonnull
ObjSet newMutableSetOf(E2 e1, E2 e2, E2 e3,
E2 e4, E2 e5, E2... restElements);
/**
* Constructs a new empty updatable set of the {@linkplain #getDefaultExpectedSize() default
* expected size}.
*
* @param the element type of the returned set
* @return a new empty updatable set
*/
@Nonnull
ObjSet newUpdatableSet();
/**
* Constructs a new empty updatable set of the given expected size.
*
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new empty updatable set of the given expected size
*/
@Nonnull
ObjSet newUpdatableSet(int expectedSize);
/**
* Constructs a new updatable set containing the elements in the specified iterable.
*
*
* If the specified iterable is an instance of {@code ObjSet} and has the same {@linkplain
* ObjSet#equivalence() equivalence} with this factory (and thus the constructed set),
* the {@code expectedSize} argument is ignored.
*
*
* @param elements the iterable whose elements are to be placed into the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new updatable set of the elements of the specified iterable
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterable elements, int expectedSize);
/**
* Constructs a new updatable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new updatable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2, int expectedSize);
/**
* Constructs a new updatable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new updatable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3, int expectedSize);
/**
* Constructs a new updatable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new updatable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4, int expectedSize);
/**
* Constructs a new updatable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
* @param elems5 the fifth source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new updatable set which merge the elements of the specified iterables
*/
ObjSet newUpdatableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4,
@Nonnull Iterable elems5, int expectedSize);
/**
* Constructs a new updatable set containing the elements traversed by the specified iterator.
*
* @param elements the iterator from which elements are to be placed into the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new updatable set containing the elements traversed by the specified iterator
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterator elements, int expectedSize);
/**
* Constructs a new updatable set of elements consumed by the callback within the given closure.
*
* Example: TODO
*
* @param elementsSupplier the function which supply mappings for the returned set via
* the callback passed in
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new updatable set of elements consumed by the callback within the given closure
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull
Consumer> elementsSupplier
, int expectedSize);
/**
* Constructs a new updatable set of elements from the given array.
*
* @param elements the array whose elements are to be placed into the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new updatable set of elements from the given array
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull E2[] elements, int expectedSize);
/**
* Constructs a new updatable set containing the elements in the specified iterable.
*
*
*
* @param elements the iterable whose elements are to be placed into the returned set
*
* @param the element type of the returned set
* @return a new updatable set of the elements of the specified iterable
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterable elements);
/**
* Constructs a new updatable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
*
* @param the element type of the returned set
* @return a new updatable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2);
/**
* Constructs a new updatable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
*
* @param the element type of the returned set
* @return a new updatable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3);
/**
* Constructs a new updatable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
*
* @param the element type of the returned set
* @return a new updatable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4);
/**
* Constructs a new updatable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
* @param elems5 the fifth source of elements for the returned set
*
* @param the element type of the returned set
* @return a new updatable set which merge the elements of the specified iterables
*/
ObjSet newUpdatableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4,
@Nonnull Iterable elems5);
/**
* Constructs a new updatable set containing the elements traversed by the specified iterator.
*
* @param elements the iterator from which elements are to be placed into the returned set
*
* @param the element type of the returned set
* @return a new updatable set containing the elements traversed by the specified iterator
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull Iterator elements);
/**
* Constructs a new updatable set of elements consumed by the callback within the given closure.
*
* Example: TODO
*
* @param elementsSupplier the function which supply mappings for the returned set via
* the callback passed in
*
* @param the element type of the returned set
* @return a new updatable set of elements consumed by the callback within the given closure
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull
Consumer> elementsSupplier
);
/**
* Constructs a new updatable set of elements from the given array.
*
* @param elements the array whose elements are to be placed into the returned set
*
* @param the element type of the returned set
* @return a new updatable set of elements from the given array
*/
@Nonnull
ObjSet newUpdatableSet(@Nonnull E2[] elements);
/**
* Constructs a new updatable singleton set of the given element.
*
* @param e1 the sole element
* @param the element type of the returned set
* @return a new updatable singleton set of the given element
*/
@Nonnull
ObjSet newUpdatableSetOf(E2 e1);
/**
* Constructs a new updatable set of the two specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param the element type of the returned set
* @return a new updatable set of the two specified elements
*/
@Nonnull
ObjSet newUpdatableSetOf(E2 e1, E2 e2);
/**
* Constructs a new updatable set of the three specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @param the element type of the returned set
* @return a new updatable set of the three specified elements
*/
@Nonnull
ObjSet newUpdatableSetOf(E2 e1, E2 e2, E2 e3);
/**
* Constructs a new updatable set of the four specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @param e4 the fourth element
* @param the element type of the returned set
* @return a new updatable set of the four specified elements
*/
@Nonnull
ObjSet newUpdatableSetOf(E2 e1, E2 e2, E2 e3,
E2 e4);
/**
* Constructs a new updatable set of the specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @param e4 the fourth element
* @param e5 the fifth element
* @param restElements the rest elements to be placed into the set
* @param the element type of the returned set
* @return a new updatable set of the specified elements
*/
@Nonnull
ObjSet newUpdatableSetOf(E2 e1, E2 e2, E2 e3,
E2 e4, E2 e5, E2... restElements);
/**
* Constructs a new immutable set containing the elements in the specified iterable.
*
*
* If the specified iterable is an instance of {@code ObjSet} and has the same {@linkplain
* ObjSet#equivalence() equivalence} with this factory (and thus the constructed set),
* the {@code expectedSize} argument is ignored.
*
*
* @param elements the iterable whose elements are to be placed into the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new immutable set of the elements of the specified iterable
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterable elements, int expectedSize);
/**
* Constructs a new immutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new immutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2, int expectedSize);
/**
* Constructs a new immutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new immutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3, int expectedSize);
/**
* Constructs a new immutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new immutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4, int expectedSize);
/**
* Constructs a new immutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
* @param elems5 the fifth source of elements for the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new immutable set which merge the elements of the specified iterables
*/
ObjSet newImmutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4,
@Nonnull Iterable elems5, int expectedSize);
/**
* Constructs a new immutable set containing the elements traversed by the specified iterator.
*
* @param elements the iterator from which elements are to be placed into the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new immutable set containing the elements traversed by the specified iterator
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterator elements, int expectedSize);
/**
* Constructs a new immutable set of elements consumed by the callback within the given closure.
*
* Example: TODO
*
* @param elementsSupplier the function which supply mappings for the returned set via
* the callback passed in
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new immutable set of elements consumed by the callback within the given closure
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull
Consumer> elementsSupplier
, int expectedSize);
/**
* Constructs a new immutable set of elements from the given array.
*
* @param elements the array whose elements are to be placed into the returned set
* @param expectedSize the expected size of the returned set
* @param the element type of the returned set
* @return a new immutable set of elements from the given array
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull E2[] elements, int expectedSize);
/**
* Constructs a new immutable set containing the elements in the specified iterable.
*
*
*
* @param elements the iterable whose elements are to be placed into the returned set
*
* @param the element type of the returned set
* @return a new immutable set of the elements of the specified iterable
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterable elements);
/**
* Constructs a new immutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
*
* @param the element type of the returned set
* @return a new immutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2);
/**
* Constructs a new immutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
*
* @param the element type of the returned set
* @return a new immutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3);
/**
* Constructs a new immutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
*
* @param the element type of the returned set
* @return a new immutable set which merge the elements of the specified iterables
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4);
/**
* Constructs a new immutable set which merge the elements of the specified iterables.
*
* @param elems1 the first source of elements for the returned set
* @param elems2 the second source of elements for the returned set
* @param elems3 the third source of elements for the returned set
* @param elems4 the fourth source of elements for the returned set
* @param elems5 the fifth source of elements for the returned set
*
* @param the element type of the returned set
* @return a new immutable set which merge the elements of the specified iterables
*/
ObjSet newImmutableSet(@Nonnull Iterable elems1,
@Nonnull Iterable elems2,
@Nonnull Iterable elems3,
@Nonnull Iterable elems4,
@Nonnull Iterable elems5);
/**
* Constructs a new immutable set containing the elements traversed by the specified iterator.
*
* @param elements the iterator from which elements are to be placed into the returned set
*
* @param the element type of the returned set
* @return a new immutable set containing the elements traversed by the specified iterator
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull Iterator elements);
/**
* Constructs a new immutable set of elements consumed by the callback within the given closure.
*
* Example: TODO
*
* @param elementsSupplier the function which supply mappings for the returned set via
* the callback passed in
*
* @param the element type of the returned set
* @return a new immutable set of elements consumed by the callback within the given closure
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull
Consumer> elementsSupplier
);
/**
* Constructs a new immutable set of elements from the given array.
*
* @param elements the array whose elements are to be placed into the returned set
*
* @param the element type of the returned set
* @return a new immutable set of elements from the given array
*/
@Nonnull
ObjSet newImmutableSet(@Nonnull E2[] elements);
/**
* Constructs a new immutable singleton set of the given element.
*
* @param e1 the sole element
* @param the element type of the returned set
* @return a new immutable singleton set of the given element
*/
@Nonnull
ObjSet newImmutableSetOf(E2 e1);
/**
* Constructs a new immutable set of the two specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param the element type of the returned set
* @return a new immutable set of the two specified elements
*/
@Nonnull
ObjSet newImmutableSetOf(E2 e1, E2 e2);
/**
* Constructs a new immutable set of the three specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @param the element type of the returned set
* @return a new immutable set of the three specified elements
*/
@Nonnull
ObjSet newImmutableSetOf(E2 e1, E2 e2, E2 e3);
/**
* Constructs a new immutable set of the four specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @param e4 the fourth element
* @param the element type of the returned set
* @return a new immutable set of the four specified elements
*/
@Nonnull
ObjSet newImmutableSetOf(E2 e1, E2 e2, E2 e3,
E2 e4);
/**
* Constructs a new immutable set of the specified elements.
*
* @param e1 the first element
* @param e2 the second element
* @param e3 the third element
* @param e4 the fourth element
* @param e5 the fifth element
* @param restElements the rest elements to be placed into the set
* @param the element type of the returned set
* @return a new immutable set of the specified elements
*/
@Nonnull
ObjSet newImmutableSetOf(E2 e1, E2 e2, E2 e3,
E2 e4, E2 e5, E2... restElements);
}