Package adql.db
Class SearchTableList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<E>
-
- cds.utils.TextualSearchList<DBTable>
-
- adql.db.SearchTableList
-
- All Implemented Interfaces:
SearchTableApi
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<DBTable>
,java.util.Collection<DBTable>
,java.util.List<DBTable>
,java.util.RandomAccess
public class SearchTableList extends TextualSearchList<DBTable> implements SearchTableApi
A list of
DBTable
elements ordered by their ADQL name in an ascending manner.In addition to an ADQL name,
DBTable
elements can be searched by specifying their schema and catalog. These last information will be used only if the ADQL table name is ambiguous, otherwise all matching elements are returned.- 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 SearchTableList()
Void constructor.SearchTableList(int initialCapacity)
Constructor with the initial capacity.SearchTableList(java.util.Collection<? extends DBTable> collection)
Constructor by copy: all the elements of the given collection ofDBTable
are copied ordered into this list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(DBTable item)
Adds the given object at the end of this list.boolean
isDistinct()
Tells whether multiple occurrences are allowed.java.util.List<DBTable>
search(ADQLTable table)
java.util.List<DBTable>
search(java.lang.String tableName)
Searches allDBTable
elements which has the given name (case insensitive).java.util.List<DBTable>
search(java.lang.String catalog, java.lang.String schema, java.lang.String table)
Searches allDBTable
elements which have the given catalog, schema, and table name (case insensitive).java.util.List<DBTable>
search(java.lang.String catalog, java.lang.String schema, java.lang.String table, byte caseSensitivity)
Searches allDBTable
elements which have the given catalog, schema, and table name, with the specified case sensitivity.void
setDistinct(boolean distinct)
Lets indicating that multiple occurrences are allowed.-
Methods inherited from class cds.utils.TextualSearchList
add, addAll, 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, removeAll, removeIf, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
SearchTableList
public SearchTableList()
Void constructor.
-
SearchTableList
public SearchTableList(java.util.Collection<? extends DBTable> collection)
Constructor by copy: all the elements of the given collection ofDBTable
are copied ordered into this list.- Parameters:
collection
- Collection ofDBTable
to copy.
-
SearchTableList
public SearchTableList(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.
-
search
public java.util.List<DBTable> search(java.lang.String tableName)
Searches allDBTable
elements which has the given name (case insensitive).- Parameters:
tableName
- ADQL name ofDBTable
to search for.- Returns:
- The corresponding
DBTable
elements. - See Also:
TextualSearchList.get(String)
-
search
public final java.util.List<DBTable> search(java.lang.String catalog, java.lang.String schema, java.lang.String table)
Searches allDBTable
elements which have the given catalog, schema, and table name (case insensitive).- Parameters:
catalog
- Catalog name.schema
- Schema name.table
- Table name.- Returns:
- The list of all matching
DBTable
elements. - See Also:
search(String, String, String, byte)
-
search
public java.util.List<DBTable> search(ADQLTable table)
- Specified by:
search
in interfaceSearchTableApi
- Parameters:
table
- AnADQLTable
.- Returns:
- The list of all corresponding
DBTable
elements. - See Also:
search(String, String, String, byte)
-
search
public java.util.List<DBTable> search(java.lang.String catalog, java.lang.String schema, java.lang.String table, byte caseSensitivity)
Searches allDBTable
elements which have the given catalog, schema, and table name, with the specified case sensitivity.- Parameters:
catalog
- Catalog name.schema
- Schema name.table
- Table name.caseSensitivity
- Case sensitivity for each table parts (one bit by part ; 0=sensitive,1=insensitive ; seeIdentifierField
for more details).- Returns:
- The list of all matching
DBTable
elements. - See Also:
IdentifierField
-
add
public boolean add(DBTable item)
Description copied from class:TextualSearchList
Adds the given object at the end of this list.- Specified by:
add
in interfacejava.util.Collection<DBTable>
- Specified by:
add
in interfacejava.util.List<DBTable>
- Overrides:
add
in classTextualSearchList<DBTable>
- Parameters:
item
- Object to add (different from NULL).- See Also:
ArrayList.add(java.lang.Object)
-
-