Package adql.query

Class ColumnReference

java.lang.Object
adql.query.ColumnReference
All Implemented Interfaces:
ADQLObject

public class ColumnReference extends Object implements ADQLObject
Represents a reference to a selected column by an index.
See Also:
  • Field Details

    • FEATURE

      public static final LanguageFeature FEATURE
      Description of this ADQL Feature.
      Since:
      2.0
  • Constructor Details

    • ColumnReference

      public ColumnReference(int index) throws ArrayIndexOutOfBoundsException
      Builds a column reference with an index of a selected column.
      Parameters:
      index - Index of a selected column (from 1).
      Throws:
      ArrayIndexOutOfBoundsException - If the given index is less or equal 0.
    • ColumnReference

      public ColumnReference(ColumnReference toCopy)
      Builds a column reference by copying the given one.
      Parameters:
      toCopy - The column reference to copy.
  • Method Details

    • getFeatureDescription

      public LanguageFeature getFeatureDescription()
      Description copied from interface: ADQLObject
      Get the description of this ADQL's Language Feature.

      Note: Getting this description is generally only useful when discovery optional features so that determining if they are allowed to be used in ADQL queries.

      Specified by:
      getFeatureDescription in interface ADQLObject
      Returns:
      Description of this ADQL object as an ADQL's feature.
    • getPosition

      public final TextPosition getPosition()
      Gets the position in the original ADQL query string.
      Specified by:
      getPosition in interface ADQLObject
      Returns:
      The position of this ColumnReference.
    • setPosition

      public void setPosition(TextPosition pos)
      Sets the position at which this ColumnReference has been found in the original ADQL query string.
      Parameters:
      pos - Position of this ColumnReference.
    • getColumnIndex

      public final int getColumnIndex()
      Gets the index of the referenced column.
      Returns:
      The index of the referenced column.
    • setColumnIndex

      public final boolean setColumnIndex(int index)
      Sets the index of the referenced column.
      Parameters:
      index - The index of the referenced column (must be > 0).
      Returns:
      true if the column referenced has been updated, false otherwise (if index <= 0).
    • isCaseSensitive

      public final boolean isCaseSensitive()
      Tells whether the column reference on a column name/alias is case sensitive.
      Returns:
      true if the column name/alias is case sensitive, false otherwise.
    • setCaseSensitive

      public final void setCaseSensitive(boolean sensitive)
      Sets the case sensitivity on the column name/alias.
      Parameters:
      sensitive - true to make case sensitive the column name/alias, false otherwise.
    • getDBLink

      public final DBColumn getDBLink()
      Gets the corresponding DBColumn.
      Returns:
      The corresponding DBColumn if
      invalid reference
      #getColumnName()
      is a column name (not an alias), or NULL otherwise.
    • setDBLink

      public final void setDBLink(DBColumn dbLink)
      Sets the DBColumn corresponding to this ADQLColumn.

      By default, this field is automatically filled by DBChecker.

      Parameters:
      dbLink - Its corresponding DBColumn if
      invalid reference
      #getColumnName()
      is a column name (not an alias), or NULL otherwise.
    • getAdqlTable

      @Deprecated public final ADQLTable getAdqlTable()
      Deprecated.
      Since v2.0. This function is never used.
      Gets the ADQLTable from which this column is supposed to come.
      Returns:
      Its source table if
      invalid reference
      #getColumnName()
      is a column name (not an alias), or NULL otherwise.
    • setAdqlTable

      @Deprecated public final void setAdqlTable(ADQLTable adqlTable)
      Deprecated.
      Since v2.0. This piece of information is never used.
      Sets the ADQLTable from which this column is supposed to come.

      By default, this field is automatically filled by DBChecker when DBChecker.check(adql.query.ADQLQuery) is called.

      Parameters:
      adqlTable - Its source table if
      invalid reference
      #getColumnName()
      is a column name (not an alias), or NULL otherwise.
    • getCopy

      public ADQLObject getCopy() throws Exception
      Description copied from interface: ADQLObject
      Gets a (deep) copy of this ADQL object.
      Specified by:
      getCopy in interface ADQLObject
      Returns:
      The copy of this ADQL object.
      Throws:
      Exception - If there is any error during the copy.
    • getName

      public String getName()
      Description copied from interface: ADQLObject
      Gets the name of this object in ADQL.
      Specified by:
      getName in interface ADQLObject
      Returns:
      The name of this ADQL object.
    • adqlIterator

      public final ADQLIterator adqlIterator()
      Description copied from interface: ADQLObject
      Gets an iterator on the intern ADQL objects.

      Note: The returned iterator is particularly used by a ISearchHandler extension to browse a whole ADQL tree.

      Specified by:
      adqlIterator in interface ADQLObject
      Returns:
      An ADQL objects iterator.
      See Also:
    • toADQL

      public String toADQL()
      Description copied from interface: ADQLObject
      Gets the ADQL expression of this object.
      Specified by:
      toADQL in interface ADQLObject
      Returns:
      The corresponding ADQL expression.