org.apache.torque.util

## Class UniqueColumnList

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.ArrayList<Column>
      - - org.apache.torque.util.UniqueColumnList

- All Implemented Interfaces:
    Serializable, Cloneable, Iterable<Column>, Collection<Column>, List<Column>, RandomAccess

      public class UniqueColumnList
      extends ArrayList<Column>

  List with unique entries. UniqueList does not allow null nor will Columns with the same SQL expression be added twice.
  Version:
    $Id: UniqueColumnList.java 1839288 2018-08-27 09:48:33Z tv $
  Author:
    Martin Poeschl
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.AbstractList

      `modCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UniqueColumnList()` Constructs an empty UniqueList.
    `UniqueColumnList(UniqueColumnList list)` Copy-constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(Column column)` Adds a Column to the list, if no column with the same SQL Expression is not already contained.
    `boolean` | `containsSqlExpression(Column column)` Checks if this list already contains a column with the same SQL expression.

    - ### Methods inherited from class java.util.ArrayList

      `add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize`

    - ### Methods inherited from class java.util.AbstractList

      `equals, hashCode`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll, toString`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.List

      `containsAll, equals, hashCode`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, stream`

- - ### Constructor Detail

    - #### UniqueColumnList

          public UniqueColumnList()

      Constructs an empty UniqueList.

    - #### UniqueColumnList

          public UniqueColumnList(UniqueColumnList list)

      Copy-constructor. Creates a shallow copy of an UniqueList.
      Parameters:
        `list` - the uniqueList to copy

  - ### Method Detail

    - #### add

          public boolean add(Column column)

      Adds a Column to the list, if no column with the same SQL Expression is not already contained.
      Specified by:
        `add` in interface `Collection<Column>`
      Specified by:
        `add` in interface `List<Column>`
      Overrides:
        `add` in class `ArrayList<Column>`
      Parameters:
        `column` - the Column to add, not null.
      Returns:
        true if the Object is added.
      Throws:
        `NullPointerException` - if column is null.

    - #### containsSqlExpression

          public boolean containsSqlExpression(Column column)

      Checks if this list already contains a column with the same SQL expression.
      Parameters:
        `column` - the column to check, not null.
      Returns:
        true if a column with the same Sql Expression is contained, false otherwise.

Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.