public class ColumnReference extends java.lang.Object implements ADQLObject
ADQLOrder
Constructor and Description |
---|
ColumnReference(ColumnReference toCopy)
Builds a column reference by copying the given one.
|
ColumnReference(int index)
Builds a column reference with an index of a selected column.
|
ColumnReference(java.lang.String colName)
Builds a column reference with a name/alias of a selected column.
|
Modifier and Type | Method and Description |
---|---|
ADQLIterator |
adqlIterator()
Gets an iterator on the intern ADQL objects.
|
ADQLTable |
getAdqlTable()
Gets the
ADQLTable from which this column is supposed to come. |
int |
getColumnIndex()
Gets the index of the referenced column.
|
java.lang.String |
getColumnName()
Gets the name/alias of the referenced column.
|
ADQLObject |
getCopy()
Gets a (deep) copy of this ADQL object.
|
DBColumn |
getDBLink()
Gets the corresponding
DBColumn . |
java.lang.String |
getName()
Gets the name of this object in ADQL.
|
TextPosition |
getPosition()
Gets the position in the original ADQL query string.
|
boolean |
isCaseSensitive()
Tells whether the column reference on a column name/alias is case sensitive.
|
boolean |
isIndex()
Tells whether the column is referenced by its index or by its name/alias.
|
void |
setAdqlTable(ADQLTable adqlTable)
Sets the
ADQLTable from which this column is supposed to come. |
void |
setCaseSensitive(boolean sensitive)
Sets the case sensitivity on the column name/alias.
|
boolean |
setColumnIndex(int index)
Sets the index of the referenced column.
|
boolean |
setColumnName(java.lang.String name)
Sets the name/alias of the referenced column.
|
void |
setDBLink(DBColumn dbLink)
Sets the
DBColumn corresponding to this ADQLColumn . |
void |
setPosition(TextPosition pos)
Sets the position at which this
ColumnReference has been found in the original ADQL query string. |
java.lang.String |
toADQL()
Gets the ADQL expression of this object.
|
public ColumnReference(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- Index of a selected column (from 1).java.lang.ArrayIndexOutOfBoundsException
- If the given index is less or equal 0.public ColumnReference(java.lang.String colName) throws java.lang.NullPointerException
colName
- A column name/alias.java.lang.NullPointerException
- If the given name is null or is an empty string.public ColumnReference(ColumnReference toCopy)
toCopy
- The column reference to copy.public final TextPosition getPosition()
getPosition
in interface ADQLObject
ColumnReference
.public void setPosition(TextPosition pos)
ColumnReference
has been found in the original ADQL query string.pos
- Position of this ColumnReference
.public final int getColumnIndex()
public final boolean setColumnIndex(int index)
index
- The index of the referenced column (must be > 0).public final boolean isIndex()
public final java.lang.String getColumnName()
public final boolean setColumnName(java.lang.String name)
name
- The referenced column's name/alias (must be different from null and from an empty string).public final boolean isCaseSensitive()
public final void setCaseSensitive(boolean sensitive)
sensitive
- true to make case sensitive the column name/alias, false otherwise.public final DBColumn getDBLink()
DBColumn
.DBColumn
if getColumnName()
is a column name (not an alias), null otherwise.public final void setDBLink(DBColumn dbLink)
Sets the DBColumn
corresponding to this ADQLColumn
.
By default, this field is automatically filled by DBChecker
.
dbLink
- Its corresponding DBColumn
if getColumnName()
is a column name (not an alias), null otherwise.public final ADQLTable getAdqlTable()
ADQLTable
from which this column is supposed to come.getColumnName()
is a column name (not an alias), otherwise null.public final void setAdqlTable(ADQLTable adqlTable)
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.
adqlTable
- Its source table if getColumnName()
is a column name (not an alias), null otherwise.public ADQLObject getCopy() throws java.lang.Exception
ADQLObject
getCopy
in interface ADQLObject
java.lang.Exception
- If there is any error during the copy.public java.lang.String getName()
ADQLObject
getName
in interface ADQLObject
public final ADQLIterator adqlIterator()
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.
adqlIterator
in interface ADQLObject
ADQLIterator
,
ISearchHandler
public java.lang.String toADQL()
ADQLObject
toADQL
in interface ADQLObject