Class UniqueList<T>

Type Parameters:
T - the type of objects contained in the List.
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess

public class UniqueList<T> extends ArrayList<T>
List with unique entries. UniqueList does not allow null nor duplicates.
Version:
$Id: UniqueList.java 1839288 2018-08-27 09:48:33Z tv $
Author:
Martin Poeschl
See Also:
  • Constructor Details

    • UniqueList

      public UniqueList()
      Constructs an empty UniqueList.
    • UniqueList

      public UniqueList(UniqueList<T> list)
      Copy-constructor. Creates a shallow copy of an UniqueList.
      Parameters:
      list - the uniqueList to copy
  • Method Details

    • add

      public boolean add(T o)
      Adds an Object to the list.
      Specified by:
      add in interface Collection<T>
      Specified by:
      add in interface List<T>
      Overrides:
      add in class ArrayList<T>
      Parameters:
      o - the Object to add
      Returns:
      true if the Object is added