Package adql.query
Class ColumnReference
java.lang.Object
adql.query.ColumnReference
- All Implemented Interfaces:
ADQLObject
Represents a reference to a selected column by an index.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionColumnReference(int index) Builds a column reference with an index of a selected column.ColumnReference(ColumnReference toCopy) Builds a column reference by copying the given one. -
Method Summary
Modifier and TypeMethodDescriptionfinal ADQLIteratorGets an iterator on the intern ADQL objects.final ADQLTableDeprecated.Since v2.0.final intGets the index of the referenced column.getCopy()Gets a (deep) copy of this ADQL object.final DBColumnGets the correspondingDBColumn.Get the description of this ADQL's Language Feature.getName()Gets the name of this object in ADQL.final TextPositionGets the position in the original ADQL query string.final booleanTells whether the column reference on a column name/alias is case sensitive.final voidsetAdqlTable(ADQLTable adqlTable) Deprecated.Since v2.0.final voidsetCaseSensitive(boolean sensitive) Sets the case sensitivity on the column name/alias.final booleansetColumnIndex(int index) Sets the index of the referenced column.final voidSets theDBColumncorresponding to thisADQLColumn.voidsetPosition(TextPosition pos) Sets the position at which thisColumnReferencehas been found in the original ADQL query string.toADQL()Gets the ADQL expression of this object.
-
Field Details
-
FEATURE
Description of this ADQL Feature.- Since:
- 2.0
-
-
Constructor Details
-
ColumnReference
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
Builds a column reference by copying the given one.- Parameters:
toCopy- The column reference to copy.
-
-
Method Details
-
getFeatureDescription
Description copied from interface:ADQLObjectGet 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:
getFeatureDescriptionin interfaceADQLObject- Returns:
- Description of this ADQL object as an ADQL's feature.
-
getPosition
Gets the position in the original ADQL query string.- Specified by:
getPositionin interfaceADQLObject- Returns:
- The position of this
ColumnReference.
-
setPosition
Sets the position at which thisColumnReferencehas been found in the original ADQL query string.- Parameters:
pos- Position of thisColumnReference.
-
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:
trueif the column referenced has been updated,falseotherwise (if index <= 0).
-
isCaseSensitive
public final boolean isCaseSensitive()Tells whether the column reference on a column name/alias is case sensitive.- Returns:
trueif the column name/alias is case sensitive,falseotherwise.
-
setCaseSensitive
public final void setCaseSensitive(boolean sensitive) Sets the case sensitivity on the column name/alias.- Parameters:
sensitive-trueto make case sensitive the column name/alias,falseotherwise.
-
getDBLink
Gets the correspondingDBColumn.- Returns:
- The corresponding
DBColumnifis a column name (not an alias), or NULL otherwise.invalid reference
#getColumnName()
-
setDBLink
Sets theDBColumncorresponding to thisADQLColumn.By default, this field is automatically filled by
DBChecker.- Parameters:
dbLink- Its correspondingDBColumnifis a column name (not an alias), or NULL otherwise.invalid reference
#getColumnName()
-
getAdqlTable
Deprecated.Since v2.0. This function is never used.Gets theADQLTablefrom which this column is supposed to come.- Returns:
- Its source table if
is a column name (not an alias), or NULL otherwise.
invalid reference
#getColumnName()
-
setAdqlTable
Deprecated.Since v2.0. This piece of information is never used.Sets theADQLTablefrom which this column is supposed to come.By default, this field is automatically filled by
DBCheckerwhenDBChecker.check(adql.query.ADQLQuery)is called.- Parameters:
adqlTable- Its source table ifis a column name (not an alias), or NULL otherwise.invalid reference
#getColumnName()
-
getCopy
Description copied from interface:ADQLObjectGets a (deep) copy of this ADQL object.- Specified by:
getCopyin interfaceADQLObject- Returns:
- The copy of this ADQL object.
- Throws:
Exception- If there is any error during the copy.
-
getName
Description copied from interface:ADQLObjectGets the name of this object in ADQL.- Specified by:
getNamein interfaceADQLObject- Returns:
- The name of this ADQL object.
-
adqlIterator
Description copied from interface:ADQLObjectGets an iterator on the intern ADQL objects.Note: The returned iterator is particularly used by a
ISearchHandlerextension to browse a whole ADQL tree.- Specified by:
adqlIteratorin interfaceADQLObject- Returns:
- An ADQL objects iterator.
- See Also:
-
toADQL
Description copied from interface:ADQLObjectGets the ADQL expression of this object.- Specified by:
toADQLin interfaceADQLObject- Returns:
- The corresponding ADQL expression.
-