Package adql.db

Class 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
    • 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 of DBTable 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)
      Searches all DBTable elements corresponding to the given ADQLTable (case insensitive).
      java.util.List<DBTable> search​(java.lang.String tableName)
      Searches all DBTable 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 all DBTable 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 all DBTable 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 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
      • 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 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 of DBTable are copied ordered into this list.
        Parameters:
        collection - Collection of DBTable 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 all DBTable elements which has the given name (case insensitive).
        Parameters:
        tableName - ADQL name of DBTable 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 all DBTable 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​(java.lang.String catalog,
                                              java.lang.String schema,
                                              java.lang.String table,
                                              byte caseSensitivity)
        Searches all DBTable 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 ; see IdentifierField 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 interface java.util.Collection<DBTable>
        Specified by:
        add in interface java.util.List<DBTable>
        Overrides:
        add in class TextualSearchList<DBTable>
        Parameters:
        item - Object to add (different from NULL).
        See Also:
        ArrayList.add(java.lang.Object)