Package adql.query
Class ADQLOrder
java.lang.Object
adql.query.ADQLOrder
- All Implemented Interfaces:
ADQLObject
Represents an item of the ORDER BY list: that's to say a column reference
or a value expression, and an optional sorting indication (ASC, DESC).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ColumnReferenceReference to the column on which the query result must be ordered.protected ADQLOperandValue on which the query result must be ordered.static final LanguageFeatureDescription of this ADQL Feature. -
Constructor Summary
ConstructorsConstructorDescriptionADQLOrder(int colIndex) Builds an order indication with the index of the selected column on which an ASCending ordering will be done.ADQLOrder(int colIndex, boolean desc) Builds an order indication with the index of the selected column on which the specified ordering will be done.Builds an ORDER BY item by copying the given one.ADQLOrder(ADQLOperand expr) Builds an order indication with the expression on which an ASCending ordering will be done.ADQLOrder(ADQLOperand expr, boolean desc) Builds an order indication with the expression on which the specified ordering will be done.Builds an order indication with the name or the alias of the selected column on which an ASCending ordering will be done.Deprecated.Since ADQL-2.1, a column reference can be a qualified column (i.e. -
Method Summary
Modifier and TypeMethodDescriptionGets an iterator on the intern ADQL objects.final ColumnReferenceGet the reference of column on which the query result will be ordered.getCopy()Gets a (deep) copy of this ADQL object.final ADQLOperandGet the expression on which the query result will be ordered.final LanguageFeatureGet 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.booleanTells how the results will be sorted.voidsetOrder(int colIndex, boolean desc) Updates the current order indication.voidsetOrder(ADQLOperand expr, boolean desc) Updates the current order indication.voidDeprecated.Since ADQL-2.1, a column reference can be a qualified column (i.e.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
-
colRef
Reference to the column on which the query result must be ordered.Important note: If NULL, this ORDER BY is done on a value expression. In such case, see
expression.- Since:
- 2.0
-
expression
Value on which the query result must be ordered.Important note: If NULL, this ORDER BY is done on a column reference. In such case, see
colRef.- Since:
- 2.0
-
-
Constructor Details
-
ADQLOrder
Builds an order indication with the index of the selected column on which an ASCending ordering will be done.- Parameters:
colIndex- The index of a selected column (from 1).- Throws:
ArrayIndexOutOfBoundsException- If the index is less or equal 0.- See Also:
-
ADQLOrder
Builds an order indication with the index of the selected column on which the specified ordering will be done.- Parameters:
colIndex- The index of a selected column (from 1).desc-truemeans DESCending order,falsemeans ASCending order.- Throws:
ArrayIndexOutOfBoundsException- If the index is less or equal 0.- See Also:
-
ADQLOrder
Builds an order indication with the name or the alias of the selected column on which an ASCending ordering will be done.- Parameters:
colName- The name or the alias of a selected column.- Throws:
NullPointerException- If the given name is NULL or is an empty string.- See Also:
-
ADQLOrder
Deprecated.Since ADQL-2.1, a column reference can be a qualified column (i.e. anADQLColumn). You should useADQLOrder(ADQLOperand)instead.Builds an order indication with the name of the alias of the selected column on which the specified ordering will be done.- Parameters:
colName- The name of the alias of a selected column.desc-truemeans DESCending order,falsemeans ASCending order.- Throws:
NullPointerException- If the given name is NULL or is an empty string.- See Also:
-
ADQLOrder
Builds an order indication with the expression on which an ASCending ordering will be done.- Parameters:
expr- The expression to order on.- Throws:
NullPointerException- If the given expression is NULL.- Since:
- 2.0
- See Also:
-
ADQLOrder
Builds an order indication with the expression on which the specified ordering will be done.- Parameters:
expr- The expression to order on.desc-truemeans DESCending order,falsemeans ASCending order.- Throws:
NullPointerException- If the given expression is NULL.- Since:
- 2.0
-
ADQLOrder
Builds an ORDER BY item by copying the given one.- Parameters:
toCopy- The ORDER BY item to copy.- Throws:
Exception- If the copy failed.
-
-
Method Details
-
isDescSorting
public boolean isDescSorting()Tells how the results will be sorted.- Returns:
trueDESCending order,falseASCending order.
-
getColumnReference
Get the reference of column on which the query result will be ordered.- Returns:
- The set column reference. Might be NULL.
- Since:
- 2.0
-
getExpression
Get the expression on which the query result will be ordered.- Returns:
- The set expression. Might be NULL.
- Since:
- 2.0
-
setOrder
Updates the current order indication.- Parameters:
colIndex- The index of a selected column (from 1).desc-truemeans DESCending order,falsemeans ASCending order.- Throws:
IndexOutOfBoundsException- If the given index is less or equal 0.ArrayIndexOutOfBoundsException
-
setOrder
Deprecated.Since ADQL-2.1, a column reference can be a qualified column (i.e. anADQLColumn). You should usesetOrder(ADQLOperand, boolean)instead.Updates the current order indication.- Parameters:
colName- The name or the alias of a selected column.desc-truemeans DESCending order,falsemeans ASCending order.- Throws:
NullPointerException- If the given name is NULL or is an empty string.
-
setOrder
Updates the current order indication.- Parameters:
expr- The expression to order on.desc-truemeans DESCending order,falsemeans ASCending order.- Throws:
NullPointerException- If the given expression is NULL.- Since:
- 2.0
-
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.
-
toADQL
Description copied from interface:ADQLObjectGets the ADQL expression of this object.- Specified by:
toADQLin interfaceADQLObject- Returns:
- The corresponding ADQL expression.
-
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.
-
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.
-
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:
-