public class SelectItem extends java.lang.Object implements ADQLObject
Represents an item of a SELECT clause.
It merely encapsulates an operand and allows to associate to it an alias (according to the following syntax: "SELECT operand AS alias").
ClauseSelect
Constructor and Description |
---|
SelectItem(ADQLOperand operand)
Builds a SELECT item just with an operand.
|
SelectItem(ADQLOperand operand,
java.lang.String alias)
Builds a SELECT item with an operand and its alias.
|
SelectItem(SelectItem toCopy)
Builds a SELECT item by copying the given one.
|
Modifier and Type | Method and Description |
---|---|
ADQLIterator |
adqlIterator()
Gets an iterator on the intern ADQL objects.
|
java.lang.String |
getAlias()
Gets the alias of the corresponding operand.
|
ADQLObject |
getCopy()
Gets a (deep) copy of this ADQL object.
|
java.lang.String |
getName()
Gets the name of this object in ADQL.
|
ADQLOperand |
getOperand()
Gets the corresponding operand.
|
TextPosition |
getPosition()
Gets the position of this object/token in the ADQL query.
|
boolean |
hasAlias()
Indicates whether the corresponding operand has an alias.
|
boolean |
isCaseSensitive()
Tells whether the alias is case sensitive.
|
void |
setAlias(java.lang.String newAlias)
Changes the alias of the corresponding operand.
|
void |
setCaseSensitive(boolean sensitive)
Sets the case sensitivity on the alias.
|
void |
setPosition(TextPosition position)
Set the position of this
SelectItem in the given ADQL query string. |
java.lang.String |
toADQL()
Gets the ADQL expression of this object.
|
public SelectItem(ADQLOperand operand)
operand
- Corresponding operand.public SelectItem(ADQLOperand operand, java.lang.String alias)
operand
- Corresponding operand.alias
- Operand alias.public SelectItem(SelectItem toCopy) throws java.lang.Exception
toCopy
- The SELECT item to copy.java.lang.Exception
- If there is an error during the copy.public final ADQLOperand getOperand()
public final boolean hasAlias()
public final java.lang.String getAlias()
public final void setAlias(java.lang.String newAlias)
newAlias
- The new alias of the operand.public final boolean isCaseSensitive()
public final void setCaseSensitive(boolean sensitive)
sensitive
- true to make case sensitive the alias, false otherwise.public final TextPosition getPosition()
ADQLObject
Gets the position of this object/token in the ADQL query.
By default, no position should be set.
getPosition
in interface ADQLObject
public final void setPosition(TextPosition position)
SelectItem
in the given ADQL query string.position
- New position of this SelectItem
.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 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