Package adql.db
Class SearchColumnList
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<DBColumn>
,Collection<DBColumn>
,List<DBColumn>
,RandomAccess
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.
- Version:
- 1.4 (09/2017)
- Author:
- Grégory Mantelet (CDS;ARI)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class cds.utils.TextualSearchList
TextualSearchList.DefaultKeyExtractor<E>, TextualSearchList.KeyExtractor<E>
-
Field Summary
Fields inherited from class cds.utils.TextualSearchList
csMap, keyExtractor, ncsMap
Fields 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 ofDBColumn
are copied ordered into this list. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds the given object at the end of this list.boolean
addAll
(Collection<? extends DBColumn> c) Appends all the objects of the given collection in this list.final int
final boolean
Tells whether multiple occurrences are allowed.final void
putTableAlias
(String tableAlias, String tableName) Adds the given association between a table name and its alias in a query.boolean
removeAll
(Collection<?> c) final void
Removes all table name/alias associations.final void
removeTableAlias
(String tableAlias) Removes the given alias from this list.search
(ADQLColumn column) Searches allDBColumn
elements corresponding to the givenADQLColumn
(case insensitive).Searches allDBColumn
elements which has the given name (case insensitive).Searches allDBColumn
elements which have the given catalog, schema, table and column name (case insensitive).Searches allDBColumn
elements which have the given catalog, schema, table and column name, with the specified case sensitivity.final void
setDistinct
(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, set
Methods inherited from class java.util.ArrayList
clone, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeIf, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
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.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
SearchColumnList
public SearchColumnList()Void constructor. -
SearchColumnList
Constructor by copy: all the elements of the given collection ofDBColumn
are copied ordered into this list.- Parameters:
collection
- Collection ofDBColumn
to 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 allDBColumn
elements which has the given name (case insensitive). -
search
Searches allDBColumn
elements 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
DBColumn
elements. - See Also:
-
search
Searches allDBColumn
elements corresponding to the givenADQLColumn
(case insensitive).- Parameters:
column
- AnADQLColumn
.- Returns:
- The list of all corresponding
DBColumn
elements. - See Also:
-
search
public List<DBColumn> search(String catalog, String schema, String table, String column, byte caseSensitivity) Searches allDBColumn
elements 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 ; seeIdentifierField
for more details).- Returns:
- The list of all matching
DBColumn
elements. - See Also:
-
add
Description copied from class:TextualSearchList
Adds the given object at the end of this list.- Specified by:
add
in interfaceCollection<DBColumn>
- Specified by:
add
in interfaceList<DBColumn>
- Overrides:
add
in classTextualSearchList<DBColumn>
- Parameters:
item
- Object to add (different from NULL).- See Also:
-
addAll
Description copied from class:TextualSearchList
Appends all the objects of the given collection in this list.- Specified by:
addAll
in interfaceCollection<DBColumn>
- Specified by:
addAll
in interfaceList<DBColumn>
- Overrides:
addAll
in classTextualSearchList<DBColumn>
- Parameters:
c
- Collection of objects to add.- Returns:
true
if this list changed as a result of the call,false
otherwise.- See Also:
-
removeAll
-