Class UniqueEList<E>

All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, SequencedCollection<E>, EList<E>
Direct Known Subclasses:
UniqueEList.FastCompare

public class UniqueEList<E> extends BasicEList<E>
A BasicEList that allows only unique elements.
See Also:
  • Constructor Details

    • UniqueEList

      public UniqueEList()
      Creates an empty instance with no initial capacity.
    • UniqueEList

      public UniqueEList(int initialCapacity)
      Creates an empty instance with the given capacity.
      Parameters:
      initialCapacity - the initial capacity of the list before it must grow.
      Throws:
      IllegalArgumentException - if the initialCapacity is negative.
    • UniqueEList

      public UniqueEList(Collection<? extends E> collection)
      Creates an instance that is a copy of the collection, with duplicates removed.
      Parameters:
      collection - the initial contents of the list.
  • Method Details

    • isUnique

      protected boolean isUnique()
      Returns true because this list requires uniqueness.
      Overrides:
      isUnique in class AbstractEList<E>
      Returns:
      true.