Class UnifiedSet<T>

All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Iterable<T>, Collection<T>, Set<T>, MutableCollection<T>, InternalIterable<T>, RichIterable<T>, MutableSet<T>, MutableSetIterable<T>, Pool<T>, SetIterable<T>, UnsortedSetIterable<T>, BatchIterable<T>

public class UnifiedSet<T> extends AbstractUnifiedSet<T> implements Externalizable
See Also:
  • Constructor Details

    • UnifiedSet

      public UnifiedSet()
    • UnifiedSet

      public UnifiedSet(int initialCapacity)
    • UnifiedSet

      public UnifiedSet(int initialCapacity, float loadFactor)
    • UnifiedSet

      public UnifiedSet(Collection<? extends T> collection)
    • UnifiedSet

      public UnifiedSet(UnifiedSet<T> set)
  • Method Details

    • newSet

      public static <K> UnifiedSet<K> newSet()
    • newSet

      public static <K> UnifiedSet<K> newSet(int size)
    • newSet

      public static <K> UnifiedSet<K> newSet(Iterable<? extends K> source)
    • newSet

      public static <K> UnifiedSet<K> newSet(int size, float loadFactor)
    • newSetWith

      public static <K> UnifiedSet<K> newSetWith(K... elements)
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<T>
      Specified by:
      clear in interface Pool<T>
      Specified by:
      clear in interface Set<T>
    • add

      public boolean add(T key)
      Specified by:
      add in interface Collection<T>
      Specified by:
      add in interface Set<T>
      Overrides:
      add in class AbstractMutableCollection<T>
    • contains

      public boolean contains(Object key)
      Description copied from interface: RichIterable
      Returns true if the iterable has an element which responds true to element.equals(object).
      Specified by:
      contains in interface Collection<T>
      Specified by:
      contains in interface RichIterable<T>
      Specified by:
      contains in interface Set<T>
      Overrides:
      contains in class AbstractRichIterable<T>
    • batchForEach

      public void batchForEach(Procedure<? super T> procedure, int sectionIndex, int sectionCount)
      Specified by:
      batchForEach in interface BatchIterable<T>
    • tap

      public MutableSet<T> tap(Procedure<? super T> procedure)
      Description copied from interface: RichIterable
      Executes the Procedure for each element in the iterable and returns this.

      Example using a Java 8 lambda expression:

       RichIterable<Person> tapped =
           people.tap(person -> LOGGER.info(person.getName()));
       

      Example using an anonymous inner class:

       RichIterable<Person> tapped =
           people.tap(new Procedure<Person>()
           {
               public void value(Person person)
               {
                   LOGGER.info(person.getName());
               }
           });
       
      Specified by:
      tap in interface MutableCollection<T>
      Specified by:
      tap in interface MutableSet<T>
      Specified by:
      tap in interface MutableSetIterable<T>
      Specified by:
      tap in interface RichIterable<T>
      Specified by:
      tap in interface SetIterable<T>
      Specified by:
      tap in interface UnsortedSetIterable<T>
      See Also:
    • each

      public void each(Procedure<? super T> procedure)
      Description copied from interface: RichIterable
      The procedure is executed for each element in the iterable.

      Example using a Java 8 lambda expression:

       people.each(person -> LOGGER.info(person.getName()));
       

      Example using an anonymous inner class:

       people.each(new Procedure<Person>()
       {
           public void value(Person 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).
      Specified by:
      each in interface RichIterable<T>
      See Also:
    • forEachWith

      public <P> void forEachWith(Procedure2<? super T,? super P> procedure, P parameter)
      Description copied from interface: InternalIterable
      The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

      Example using a Java 8 lambda:

       people.forEachWith((Person person, Person other) ->
           {
               if (person.isRelatedTo(other))
               {
                    LOGGER.info(person.getName());
               }
           }, fred);
       

      Example using an anonymous inner class:

       people.forEachWith(new Procedure2<Person, Person>()
       {
           public void value(Person person, Person other)
           {
               if (person.isRelatedTo(other))
               {
                    LOGGER.info(person.getName());
               }
           }
       }, fred);
       
      Specified by:
      forEachWith in interface InternalIterable<T>
      Overrides:
      forEachWith in class AbstractRichIterable<T>
    • forEachWithIndex

      public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
      Description copied from interface: InternalIterable
      Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

      Example using a Java 8 lambda:

       people.forEachWithIndex((Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));
       

      Example using an anonymous inner class:

       people.forEachWithIndex(new ObjectIntProcedure<Person>()
       {
           public void value(Person person, int index)
           {
               LOGGER.info("Index: " + index + " person: " + person.getName());
           }
       });
       
      Specified by:
      forEachWithIndex in interface InternalIterable<T>
      Overrides:
      forEachWithIndex in class AbstractRichIterable<T>
    • newEmpty

      public UnifiedSet<T> newEmpty()
      Description copied from interface: MutableCollection
      Creates a new empty mutable version of the same collection type. For example, if this instance is a FastList, this method will return a new empty FastList. If the class of this instance is immutable or fixed size (i.e. SingletonList) then a mutable alternative to the class will be provided.
      Specified by:
      newEmpty in interface MutableCollection<T>
      Specified by:
      newEmpty in interface MutableSet<T>
    • newEmpty

      public UnifiedSet<T> newEmpty(int size)
      Specified by:
      newEmpty in class AbstractUnifiedSet<T>
    • getFirst

      public T getFirst()
      Description copied from interface: RichIterable
      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.

      Specified by:
      getFirst in interface RichIterable<T>
    • getLast

      public T getLast()
      Description copied from interface: RichIterable
      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.

      Specified by:
      getLast in interface RichIterable<T>
    • select

      public UnifiedSet<T> select(Predicate<? super T> predicate)
      Description copied from interface: RichIterable
      Returns all elements of the source collection that return true when evaluating the predicate. This method is also commonly called filter.

      Example using a Java 8 lambda expression:

       RichIterable<Person> selected =
           people.select(person -> person.getAddress().getCity().equals("London"));
       

      Example using an anonymous inner class:

       RichIterable<Person> selected =
           people.select(new Predicate<Person>()
           {
               public boolean accept(Person person)
               {
                   return person.getAddress().getCity().equals("London");
               }
           });
       
      Specified by:
      select in interface MutableCollection<T>
      Specified by:
      select in interface MutableSet<T>
      Specified by:
      select in interface MutableSetIterable<T>
      Specified by:
      select in interface RichIterable<T>
      Specified by:
      select in interface SetIterable<T>
      Specified by:
      select in interface UnsortedSetIterable<T>
    • selectWith

      public <P> UnifiedSet<T> selectWith(Predicate2<? super T,? super P> predicate, P parameter)
      Description copied from interface: RichIterable
      Similar to RichIterable.select(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

      E.g. return a Collection of Person elements where the person has an age greater than or equal to 18 years

      Example using a Java 8 lambda expression:

       RichIterable<Person> selected =
           people.selectWith((Person person, Integer age) -> person.getAge()>= age, Integer.valueOf(18));
       

      Example using an anonymous inner class:

       RichIterable<Person> selected =
           people.selectWith(new Predicate2<Person, Integer>()
           {
               public boolean accept(Person person, Integer age)
               {
                   return person.getAge()>= age;
               }
           }, Integer.valueOf(18));
       
      Specified by:
      selectWith in interface MutableCollection<T>
      Specified by:
      selectWith in interface MutableSet<T>
      Specified by:
      selectWith in interface MutableSetIterable<T>
      Specified by:
      selectWith in interface RichIterable<T>
      Specified by:
      selectWith in interface SetIterable<T>
      Specified by:
      selectWith in interface UnsortedSetIterable<T>
      Parameters:
      predicate - a Predicate2 to use as the select criteria
      parameter - a parameter to pass in for evaluation of the second argument P in predicate
      See Also:
    • reject

      public UnifiedSet<T> reject(Predicate<? super T> predicate)
      Description copied from interface: RichIterable
      Returns all elements of the source collection that return false when evaluating of the predicate. This method is also sometimes called filterNot and is the equivalent of calling iterable.select(Predicates.not(predicate)).

      Example using a Java 8 lambda expression:

       RichIterable<Person> rejected =
           people.reject(person -> person.person.getLastName().equals("Smith"));
       

      Example using an anonymous inner class:

       RichIterable<Person> rejected =
           people.reject(new Predicate<Person>()
           {
               public boolean accept(Person person)
               {
                   return person.person.getLastName().equals("Smith");
               }
           });
       
      Specified by:
      reject in interface MutableCollection<T>
      Specified by:
      reject in interface MutableSet<T>
      Specified by:
      reject in interface MutableSetIterable<T>
      Specified by:
      reject in interface RichIterable<T>
      Specified by:
      reject in interface SetIterable<T>
      Specified by:
      reject in interface UnsortedSetIterable<T>
      Parameters:
      predicate - a Predicate to use as the reject criteria
      Returns:
      a RichIterable that contains elements that cause Predicate.accept(Object) method to evaluate to false
    • rejectWith

      public <P> UnifiedSet<T> rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
      Description copied from interface: RichIterable
      Similar to RichIterable.reject(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

      E.g. return a Collection of Person elements where the person has an age greater than or equal to 18 years

      Example using a Java 8 lambda expression:

       RichIterable<Person> rejected =
           people.rejectWith((Person person, Integer age) -> person.getAge() < age, Integer.valueOf(18));
       

      Example using an anonymous inner class:

       MutableList<Person> rejected =
           people.rejectWith(new Predicate2<Person, Integer>()
           {
               public boolean accept(Person person, Integer age)
               {
                   return person.getAge() < age;
               }
           }, Integer.valueOf(18));
       
      Specified by:
      rejectWith in interface MutableCollection<T>
      Specified by:
      rejectWith in interface MutableSet<T>
      Specified by:
      rejectWith in interface MutableSetIterable<T>
      Specified by:
      rejectWith in interface RichIterable<T>
      Specified by:
      rejectWith in interface SetIterable<T>
      Specified by:
      rejectWith in interface UnsortedSetIterable<T>
      Parameters:
      predicate - a Predicate2 to use as the select criteria
      parameter - a parameter to pass in for evaluation of the second argument P in predicate
      See Also:
    • selectAndRejectWith

      public <P> Twin<MutableList<T>> selectAndRejectWith(Predicate2<? super T,? super P> predicate, P parameter)
      Description copied from interface: MutableCollection
      Filters a collection into two separate collections based on a predicate returned via a Pair.
      e.g.
       return lastNames.selectAndRejectWith(Predicates2.lessThan(), "Mason");
       
      Specified by:
      selectAndRejectWith in interface MutableCollection<T>
      Overrides:
      selectAndRejectWith in class AbstractMutableCollection<T>
    • partition

      public PartitionMutableSet<T> partition(Predicate<? super T> predicate)
      Description copied from interface: RichIterable
      Filters a collection into a PartitionedIterable based on the evaluation of the predicate.

      Example using a Java 8 lambda expression:

       PartitionIterable<Person> newYorkersAndNonNewYorkers =
           people.partition(person -> person.getAddress().getState().getName().equals("New York"));
       

      Example using an anonymous inner class:

       PartitionIterable<Person> newYorkersAndNonNewYorkers =
           people.partition(new Predicate<Person>()
           {
               public boolean accept(Person person)
               {
                   return person.getAddress().getState().getName().equals("New York");
               }
           });
       
      Specified by:
      partition in interface MutableCollection<T>
      Specified by:
      partition in interface MutableSet<T>
      Specified by:
      partition in interface MutableSetIterable<T>
      Specified by:
      partition in interface RichIterable<T>
      Specified by:
      partition in interface SetIterable<T>
    • partitionWith

      public <P> PartitionMutableSet<T> partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
      Description copied from interface: RichIterable
      Filters a collection into a PartitionIterable based on the evaluation of the predicate.

      Example using a Java 8 lambda expression:

       PartitionIterable<Person> newYorkersAndNonNewYorkers =
           people.partitionWith((Person person, String state) -> person.getAddress().getState().getName().equals(state), "New York");
       

      Example using an anonymous inner class:

       PartitionIterable<Person> newYorkersAndNonNewYorkers =
           people.partitionWith(new Predicate2<Person, String>()
           {
               public boolean accept(Person person, String state)
               {
                   return person.getAddress().getState().getName().equals(state);
               }
           }, "New York");
       
      Specified by:
      partitionWith in interface MutableCollection<T>
      Specified by:
      partitionWith in interface MutableSet<T>
      Specified by:
      partitionWith in interface MutableSetIterable<T>
      Specified by:
      partitionWith in interface RichIterable<T>
      Specified by:
      partitionWith in interface SetIterable<T>
    • selectInstancesOf

      public <S> UnifiedSet<S> selectInstancesOf(Class<S> clazz)
      Description copied from interface: RichIterable
      Returns all elements of the source collection that are instances of the Class clazz.
       RichIterable<Integer> integers =
           List.mutable.with(new Integer(0), new Long(0L), new Double(0.0)).selectInstancesOf(Integer.class);
       
      Specified by:
      selectInstancesOf in interface MutableCollection<T>
      Specified by:
      selectInstancesOf in interface MutableSet<T>
      Specified by:
      selectInstancesOf in interface MutableSetIterable<T>
      Specified by:
      selectInstancesOf in interface RichIterable<T>
      Specified by:
      selectInstancesOf in interface SetIterable<T>
      Specified by:
      selectInstancesOf in interface UnsortedSetIterable<T>
    • toImmutable

      public ImmutableSet<T> toImmutable()
      Description copied from interface: MutableSet
      Returns an immutable copy of this set. If the set is immutable, it returns itself.
      Specified by:
      toImmutable in interface MutableCollection<T>
      Specified by:
      toImmutable in interface MutableSet<T>
      Specified by:
      toImmutable in interface SetIterable<T>
      Specified by:
      toImmutable in interface UnsortedSetIterable<T>
    • with

      public UnifiedSet<T> with(T element)
      Description copied from interface: MutableCollection
      This method allows mutable and fixed size collections the ability to add elements to their existing elements. In order to support fixed size a new instance of a collection would have to be returned taking the elements of the original collection and appending the new element to form the new collection. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:
       MutableCollection<String> list = list.with("1");
       list = list.with("2");
       return list;
       
      In the case of FixedSizeCollection a new instance of MutableCollection will be returned by with, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling add on itself.
      Specified by:
      with in interface MutableCollection<T>
      Specified by:
      with in interface MutableSet<T>
      Specified by:
      with in interface MutableSetIterable<T>
      See Also:
    • with

      public UnifiedSet<T> with(T element1, T element2)
    • with

      public UnifiedSet<T> with(T element1, T element2, T element3)
    • with

      public UnifiedSet<T> with(T... elements)
    • withAll

      public UnifiedSet<T> withAll(Iterable<? extends T> iterable)
      Description copied from interface: MutableCollection
      This method allows mutable and fixed size collections the ability to add multiple elements to their existing elements. In order to support fixed size a new instance of a collection would have to be returned taking the elements of the original collection and appending the new elements to form the new collection. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:
       MutableCollection<String> list = list.withAll(FastList.newListWith("1", "2"));
       
      In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withAll, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling addAll on itself.
      Specified by:
      withAll in interface MutableCollection<T>
      Specified by:
      withAll in interface MutableSet<T>
      Specified by:
      withAll in interface MutableSetIterable<T>
      See Also:
    • without

      public UnifiedSet<T> without(T element)
      Description copied from interface: MutableCollection
      This method allows mutable and fixed size collections the ability to remove elements from their existing elements. In order to support fixed size a new instance of a collection would have to be returned containing the elements that would be left from the original collection after calling remove. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:
       MutableCollection<String> list = list.without("1");
       list = list.without("2");
       return list;
       
      In the case of FixedSizeCollection a new instance of MutableCollection will be returned by without, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling remove on itself.
      Specified by:
      without in interface MutableCollection<T>
      Specified by:
      without in interface MutableSet<T>
      Specified by:
      without in interface MutableSetIterable<T>
      See Also:
    • withoutAll

      public UnifiedSet<T> withoutAll(Iterable<? extends T> elements)
      Description copied from interface: MutableCollection
      This method allows mutable and fixed size collections the ability to remove multiple elements from their existing elements. In order to support fixed size a new instance of a collection would have to be returned containing the elements that would be left from the original collection after calling removeAll. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:
       MutableCollection<String> list = list.withoutAll(FastList.newListWith("1", "2"));
       
      In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withoutAll, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling removeAll on itself.
      Specified by:
      withoutAll in interface MutableCollection<T>
      Specified by:
      withoutAll in interface MutableSet<T>
      Specified by:
      withoutAll in interface MutableSetIterable<T>
      See Also:
    • addAllIterable

      public boolean addAllIterable(Iterable<? extends T> iterable)
      Specified by:
      addAllIterable in interface MutableCollection<T>
      Overrides:
      addAllIterable in class AbstractMutableCollection<T>
      See Also:
    • remove

      public boolean remove(Object key)
      Specified by:
      remove in interface Collection<T>
      Specified by:
      remove in interface Set<T>
      Overrides:
      remove in class AbstractMutableCollection<T>
    • size

      public int size()
      Description copied from interface: RichIterable
      Returns the number of items in this iterable.
      Specified by:
      size in interface BatchIterable<T>
      Specified by:
      size in interface Collection<T>
      Specified by:
      size in interface Pool<T>
      Specified by:
      size in interface RichIterable<T>
      Specified by:
      size in interface Set<T>
    • equals

      public boolean equals(Object object)
      Description copied from interface: SetIterable
      Follows the same general contract as Set.equals(Object).
      Specified by:
      equals in interface Collection<T>
      Specified by:
      equals in interface Set<T>
      Specified by:
      equals in interface SetIterable<T>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Description copied from interface: SetIterable
      Follows the same general contract as Set.hashCode().
      Specified by:
      hashCode in interface Collection<T>
      Specified by:
      hashCode in interface Set<T>
      Specified by:
      hashCode in interface SetIterable<T>
      Overrides:
      hashCode in class Object
    • trimToSize

      public boolean trimToSize()
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • retainAllIterable

      public boolean retainAllIterable(Iterable<?> iterable)
      Specified by:
      retainAllIterable in interface MutableCollection<T>
      Overrides:
      retainAllIterable in class AbstractMutableCollection<T>
      See Also:
    • clone

      public UnifiedSet<T> clone()
      Specified by:
      clone in interface MutableSet<T>
      Specified by:
      clone in class AbstractUnifiedSet<T>
    • toArray

      public Object[] toArray()
      Description copied from interface: RichIterable
      Converts this iterable to an array.
      Specified by:
      toArray in interface Collection<T>
      Specified by:
      toArray in interface RichIterable<T>
      Specified by:
      toArray in interface Set<T>
      Overrides:
      toArray in class AbstractRichIterable<T>
      See Also:
    • toArray

      public <T> T[] toArray(T[] array)
      Description copied from interface: RichIterable
      Converts this iterable to an array using the specified target array, assuming the target array is as long or longer than the iterable.
      Specified by:
      toArray in interface Collection<T>
      Specified by:
      toArray in interface RichIterable<T>
      Specified by:
      toArray in interface Set<T>
      Overrides:
      toArray in class AbstractRichIterable<T>
      See Also:
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Collection<T>
      Specified by:
      iterator in interface Iterable<T>
      Specified by:
      iterator in interface Set<T>
    • groupBy

      public <V> UnifiedSetMultimap<V,T> groupBy(Function<? super T,? extends V> function)
      Description copied from interface: RichIterable
      For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable.

      Example using a Java 8 method reference:

       Multimap<String, Person> peopleByLastName =
           people.groupBy(Person::getLastName);
       

      Example using an anonymous inner class:

       Multimap<String, Person> peopleByLastName =
           people.groupBy(new Function<Person, String>()
           {
               public String valueOf(Person person)
               {
                   return person.getLastName();
               }
           });
       
      Specified by:
      groupBy in interface MutableCollection<T>
      Specified by:
      groupBy in interface MutableSet<T>
      Specified by:
      groupBy in interface MutableSetIterable<T>
      Specified by:
      groupBy in interface RichIterable<T>
      Specified by:
      groupBy in interface UnsortedSetIterable<T>
    • groupByEach

      public <V> UnifiedSetMultimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
      Description copied from interface: RichIterable
      Similar to RichIterable.groupBy(Function), except the result of evaluating function will return a collection of keys for each value.
      Specified by:
      groupByEach in interface MutableCollection<T>
      Specified by:
      groupByEach in interface MutableSet<T>
      Specified by:
      groupByEach in interface MutableSetIterable<T>
      Specified by:
      groupByEach in interface RichIterable<T>
      Specified by:
      groupByEach in interface UnsortedSetIterable<T>
    • get

      public T get(T key)
      Description copied from interface: Pool
      Locates an object in the pool which is equal to key.
      Specified by:
      get in interface Pool<T>
      Parameters:
      key - the value to look for
      Returns:
      The object reference in the pool equal to key or null.
    • put

      public T put(T key)
      Description copied from interface: Pool
      Puts key into the pool. If there is no existing object that is equal to key, key will be added to the pool and the return value will be the same instance. If there is an existing object in the pool that is equal to key, the pool will remain unchanged and the pooled instance will be is returned.
      Specified by:
      put in interface Pool<T>
      Parameters:
      key - the value to add if not in the pool
      Returns:
      the object reference in the pool equal to key (either key itself or the existing reference)
    • removeFromPool

      public T removeFromPool(T key)
      Description copied from interface: Pool
      Locates an object in the pool which is equal to key and removes it.
      Specified by:
      removeFromPool in interface Pool<T>
      Parameters:
      key - object to remove
      Returns:
      The object reference in the pool equal to key or null.
    • asParallel

      public ParallelUnsortedSetIterable<T> asParallel(ExecutorService executorService, int batchSize)
      Description copied from interface: SetIterable
      Returns a parallel iterable of this SetIterable.
      Specified by:
      asParallel in interface SetIterable<T>
      Specified by:
      asParallel in interface UnsortedSetIterable<T>