Package adql.db
Class SearchColumnList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<E>
-
- cds.utils.TextualSearchList<DBColumn>
-
- adql.db.SearchColumnList
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<DBColumn>,java.util.Collection<DBColumn>,java.util.List<DBColumn>,java.util.RandomAccess
public class SearchColumnList extends TextualSearchList<DBColumn>
A list of
DBColumnelements ordered by their ADQL name in an ascending manner.In addition to an ADQL name,
DBColumnelements 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:
- Serialized Form
-
-
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
-
-
Constructor Summary
Constructors Constructor Description SearchColumnList()Void constructor.SearchColumnList(int initialCapacity)Constructor with the initial capacity.SearchColumnList(java.util.Collection<DBColumn> collection)Constructor by copy: all the elements of the given collection ofDBColumnare copied ordered into this list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(DBColumn item)Adds the given object at the end of this list.booleanaddAll(java.util.Collection<? extends DBColumn> c)Appends all the objects of the given collection in this list.intgetNbTableAliases()booleanisDistinct()Tells whether multiple occurrences are allowed.voidputTableAlias(java.lang.String tableAlias, java.lang.String tableName)Adds the given association between a table name and its alias in a query.booleanremoveAll(java.util.Collection<?> c)voidremoveAllTableAliases()Removes all table name/alias associations.voidremoveTableAlias(java.lang.String tableAlias)Removes the given alias from this list.java.util.List<DBColumn>search(ADQLColumn column)Searches allDBColumnelements corresponding to the givenADQLColumn(case insensitive).java.util.List<DBColumn>search(java.lang.String columnName)Searches allDBColumnelements which has the given name (case insensitive).java.util.List<DBColumn>search(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String column)Searches allDBColumnelements which have the given catalog, schema, table and column name (case insensitive).java.util.List<DBColumn>search(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String column, byte caseSensitivity)Searches allDBColumnelements which have the given catalog, schema, table and column name, with the specified case sensitivity.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, 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
-
-
-
-
Constructor Detail
-
SearchColumnList
public SearchColumnList()
Void constructor.
-
SearchColumnList
public SearchColumnList(java.util.Collection<DBColumn> collection)
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 Detail
-
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
public final void putTableAlias(java.lang.String tableAlias, java.lang.String tableName)Adds the given association between a table name and its alias in a query.- Parameters:
tableAlias- Table alias.tableName- Table name.
-
removeTableAlias
public final void removeTableAlias(java.lang.String tableAlias)
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
public java.util.List<DBColumn> search(java.lang.String columnName)
Searches allDBColumnelements which has the given name (case insensitive).- Parameters:
columnName- ADQL name ofDBColumnto search for.- Returns:
- The corresponding
DBColumnelements. - See Also:
TextualSearchList.get(String)
-
search
public final java.util.List<DBColumn> search(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String column)
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(String, String, String, String, byte)
-
search
public java.util.List<DBColumn> search(ADQLColumn column)
Searches allDBColumnelements corresponding to the givenADQLColumn(case insensitive).- Parameters:
column- AnADQLColumn.- Returns:
- The list of all corresponding
DBColumnelements. - See Also:
search(String, String, String, String, byte)
-
search
public java.util.List<DBColumn> search(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.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:
IdentifierField
-
add
public boolean add(DBColumn item)
Description copied from class:TextualSearchListAdds the given object at the end of this list.- Specified by:
addin interfacejava.util.Collection<DBColumn>- Specified by:
addin interfacejava.util.List<DBColumn>- Overrides:
addin classTextualSearchList<DBColumn>- Parameters:
item- Object to add (different from NULL).- See Also:
ArrayList.add(java.lang.Object)
-
addAll
public boolean addAll(java.util.Collection<? extends DBColumn> c)
Description copied from class:TextualSearchListAppends all the objects of the given collection in this list.- Specified by:
addAllin interfacejava.util.Collection<DBColumn>- Specified by:
addAllin interfacejava.util.List<DBColumn>- Overrides:
addAllin classTextualSearchList<DBColumn>- Parameters:
c- Collection of objects to add.- Returns:
trueif this list changed as a result of the call,falseotherwise.- See Also:
ArrayList.addAll(java.util.Collection),TextualSearchList.add(Object)
-
-