Package adql.query
Class ADQLOrder
java.lang.Object
adql.query.ColumnReference
adql.query.ADQLOrder
- All Implemented Interfaces:
ADQLObject
Represents an item of the ORDER BY list: that's to say a column reference plus a sorting indication (ASC, DESC).
- Version:
- 06/2011
- Author:
- Grégory Mantelet (CDS)
-
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.Builds an order indication with the name or the alias of the selected column on which an ASCending ordering will be done.Builds an order indication with the name of the alias of the selected column on which the specified ordering will be done. -
Method Summary
Modifier and TypeMethodDescriptiongetCopy()Gets a (deep) copy of this ADQL object.getName()Gets the name of this object in ADQL.booleanTells how the results will be sorted.voidsetOrder(int colIndex, boolean desc) Updates the current order indication.voidUpdates the current order indication.toADQL()Gets the ADQL expression of this object.Methods inherited from class adql.query.ColumnReference
adqlIterator, getAdqlTable, getColumnIndex, getColumnName, getDBLink, getPosition, isCaseSensitive, isIndex, setAdqlTable, setCaseSensitive, setColumnIndex, setColumnName, setDBLink, setPosition
-
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- true means DESCending order, false means ASCending order.- Throws:
ArrayIndexOutOfBoundsException- If the index is less or equal 0.
-
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
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- true means DESCending order, false means ASCending order.- Throws:
NullPointerException- If the given name is null or is an empty string.
-
ADQLOrder
Builds an ORDER BY item by copying the given one.- Parameters:
toCopy- The ORDER BY item to copy.
-
-
Method Details
-
isDescSorting
public boolean isDescSorting()Tells how the results will be sorted.- Returns:
- true DESCending order, false ASCending order.
-
setOrder
Updates the current order indication.- Parameters:
colIndex- The index of a selected column (from 1).desc- true means DESCending order, false means ASCending order.- Throws:
IndexOutOfBoundsException- If the given index is less or equal 0.ArrayIndexOutOfBoundsException
-
setOrder
Updates the current order indication.- Parameters:
colName- The name or the alias of a selected column.desc- true means DESCending order, false means ASCending order.- Throws:
NullPointerException- If the given name is null or is an empty string.
-
getCopy
Description copied from interface:ADQLObjectGets a (deep) copy of this ADQL object.- Specified by:
getCopyin interfaceADQLObject- Overrides:
getCopyin classColumnReference- 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- Overrides:
getNamein classColumnReference- Returns:
- The name of this ADQL object.
-
toADQL
Description copied from interface:ADQLObjectGets the ADQL expression of this object.- Specified by:
toADQLin interfaceADQLObject- Overrides:
toADQLin classColumnReference- Returns:
- The corresponding ADQL expression.
-