Package org.apache.torque.util
Class UniqueColumnList
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Column>,Collection<Column>,List<Column>,RandomAccess
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:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty UniqueList.Copy-constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a Column to the list, if no column with the same SQL Expression is not already contained.booleancontainsSqlExpression(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, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll
-
Constructor Details
-
UniqueColumnList
public UniqueColumnList()Constructs an empty UniqueList. -
UniqueColumnList
Copy-constructor. Creates a shallow copy of an UniqueList.- Parameters:
list- the uniqueList to copy
-
-
Method Details
-
add
Adds a Column to the list, if no column with the same SQL Expression is not already contained.- Specified by:
addin interfaceCollection<Column>- Specified by:
addin interfaceList<Column>- Overrides:
addin classArrayList<Column>- Parameters:
column- the Column to add, not null.- Returns:
- true if the Object is added.
- Throws:
NullPointerException- if column is null.
-
containsSqlExpression
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.
-