Package adql.db
Class SearchColumnList
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<DBColumn>,Collection<DBColumn>,List<DBColumn>,RandomAccess,SequencedCollection<DBColumn>
A list of
DBColumn elements ordered by their ADQL name in an
ascending manner.
In addition to an ADQL name, DBColumn elements can be searched by
specifying their table, schema and catalog. These last information will be
used only if the ADQL column name is ambiguous, otherwise all matching
elements are returned.
Note: Table aliases can be listed here with their corresponding table name. Consequently, a table alias can be given as table name in the search parameters.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class cds.utils.TextualSearchList
cds.utils.TextualSearchList.DefaultKeyExtractor<E>, cds.utils.TextualSearchList.KeyExtractor<E> -
Field Summary
Fields inherited from class cds.utils.TextualSearchList
csMap, keyExtractor, ncsMapFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionVoid constructor.SearchColumnList(int initialCapacity) Constructor with the initial capacity.SearchColumnList(Collection<DBColumn> collection) Constructor by copy: all the elements of the given collection ofDBColumnare copied ordered into this list. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends DBColumn> c) Appends all the objects of the given collection in this list.final intfinal booleanTells whether multiple occurrences are allowed.final voidputTableAlias(String tableAlias, String tableName) Adds the given association between a table name and its alias in a query.booleanremoveAll(Collection<?> c) final voidRemoves all table name/alias associations.final voidremoveTableAlias(String tableAlias) Removes the given alias from this list.search(ADQLColumn column) Searches allDBColumnelements corresponding to the givenADQLColumn(case insensitive).Searches allDBColumnelements which has the given name (case insensitive).Searches allDBColumnelements which have the given catalog, schema, table and column name (case insensitive).Searches allDBColumnelements which have the given catalog, schema, table and column name, with the specified case sensitivity.final voidsetDistinct(boolean distinct) Lets indicating that multiple occurrences are allowed.Methods inherited from class cds.utils.TextualSearchList
add, addAll, clear, contains, get, get, remove, remove, removeRange, setMethods inherited from class java.util.ArrayList
addFirst, addLast, clone, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeFirst, removeIf, removeLast, replaceAll, retainAll, 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, reversed
-
Constructor Details
-
SearchColumnList
public SearchColumnList()Void constructor. -
SearchColumnList
Constructor by copy: all the elements of the given collection ofDBColumnare copied ordered into this list.- Parameters:
collection- Collection ofDBColumnto copy.
-
SearchColumnList
public SearchColumnList(int initialCapacity) Constructor with the initial capacity.- Parameters:
initialCapacity- Initial capacity of this list.
-
-
Method Details
-
isDistinct
public final boolean isDistinct()Tells whether multiple occurrences are allowed.- Returns:
- true means that multiple occurrences are allowed, false otherwise.
-
setDistinct
public final void setDistinct(boolean distinct) Lets indicating that multiple occurrences are allowed.- Parameters:
distinct- true means that multiple occurrences are allowed, false otherwise.
-
putTableAlias
Adds the given association between a table name and its alias in a query.- Parameters:
tableAlias- Table alias.tableName- Table name.
-
removeTableAlias
Removes the given alias from this list.- Parameters:
tableAlias- The table alias which must be removed.
-
removeAllTableAliases
public final void removeAllTableAliases()Removes all table name/alias associations. -
getNbTableAliases
public final int getNbTableAliases() -
search
Searches allDBColumnelements which has the given name (case insensitive). -
search
Searches allDBColumnelements which have the given catalog, schema, table and column name (case insensitive).- Parameters:
catalog- Catalog name.schema- Schema name.table- Table name.column- Column name.- Returns:
- The list of all matching
DBColumnelements. - See Also:
-
search
Searches allDBColumnelements corresponding to the givenADQLColumn(case insensitive).- Parameters:
column- AnADQLColumn.- Returns:
- The list of all corresponding
DBColumnelements. - See Also:
-
search
public List<DBColumn> search(String catalog, String schema, String table, String column, byte caseSensitivity) Searches allDBColumnelements which have the given catalog, schema, table and column name, with the specified case sensitivity.- Parameters:
catalog- Catalog name.schema- Schema name.table- Table name.column- Column name.caseSensitivity- Case sensitivity for each column parts (one bit by part ; 0=sensitive,1=insensitive ; seeIdentifierFieldfor more details).- Returns:
- The list of all matching
DBColumnelements. - See Also:
-
add
-
addAll
Description copied from class:cds.utils.TextualSearchListAppends all the objects of the given collection in this list.- Specified by:
addAllin interfaceCollection<DBColumn>- Specified by:
addAllin interfaceList<DBColumn>- Overrides:
addAllin classcds.utils.TextualSearchList<DBColumn>- Parameters:
c- Collection of objects to add.- Returns:
trueif this list changed as a result of the call,falseotherwise.- See Also:
-
removeAll
-