Package adql.query
Class ADQLOrder
- java.lang.Object
-
- adql.query.ColumnReference
-
- adql.query.ADQLOrder
-
- All Implemented Interfaces:
ADQLObject
public class ADQLOrder extends ColumnReference
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
Constructors Constructor Description ADQLOrder(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.ADQLOrder(ADQLOrder toCopy)Builds an ORDER BY item by copying the given one.ADQLOrder(java.lang.String colName)Builds an order indication with the name or the alias of the selected column on which an ASCending ordering will be done.ADQLOrder(java.lang.String colName, boolean desc)Builds an order indication with the name of the alias of the selected column on which the specified ordering will be done.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ADQLObjectgetCopy()Gets a (deep) copy of this ADQL object.java.lang.StringgetName()Gets the name of this object in ADQL.booleanisDescSorting()Tells how the results will be sorted.voidsetOrder(int colIndex, boolean desc)Updates the current order indication.voidsetOrder(java.lang.String colName, boolean desc)Updates the current order indication.java.lang.StringtoADQL()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 Detail
-
ADQLOrder
public ADQLOrder(int colIndex) throws java.lang.ArrayIndexOutOfBoundsExceptionBuilds 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:
java.lang.ArrayIndexOutOfBoundsException- If the index is less or equal 0.- See Also:
ADQLOrder(int, boolean)
-
ADQLOrder
public ADQLOrder(int colIndex, boolean desc) throws java.lang.ArrayIndexOutOfBoundsExceptionBuilds 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:
java.lang.ArrayIndexOutOfBoundsException- If the index is less or equal 0.
-
ADQLOrder
public ADQLOrder(java.lang.String colName) throws java.lang.NullPointerExceptionBuilds 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:
java.lang.NullPointerException- If the given name is null or is an empty string.- See Also:
ADQLOrder(String, boolean)
-
ADQLOrder
public ADQLOrder(java.lang.String colName, boolean desc) throws java.lang.NullPointerExceptionBuilds 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:
java.lang.NullPointerException- If the given name is null or is an empty string.
-
ADQLOrder
public ADQLOrder(ADQLOrder toCopy)
Builds an ORDER BY item by copying the given one.- Parameters:
toCopy- The ORDER BY item to copy.
-
-
Method Detail
-
isDescSorting
public boolean isDescSorting()
Tells how the results will be sorted.- Returns:
- true DESCending order, false ASCending order.
-
setOrder
public void setOrder(int colIndex, boolean desc) throws java.lang.ArrayIndexOutOfBoundsExceptionUpdates the current order indication.- Parameters:
colIndex- The index of a selected column (from 1).desc- true means DESCending order, false means ASCending order.- Throws:
java.lang.IndexOutOfBoundsException- If the given index is less or equal 0.java.lang.ArrayIndexOutOfBoundsException
-
setOrder
public void setOrder(java.lang.String colName, boolean desc) throws java.lang.NullPointerExceptionUpdates 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:
java.lang.NullPointerException- If the given name is null or is an empty string.
-
getCopy
public ADQLObject getCopy() throws java.lang.Exception
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:
java.lang.Exception- If there is any error during the copy.
-
getName
public java.lang.String 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
public java.lang.String toADQL()
Description copied from interface:ADQLObjectGets the ADQL expression of this object.- Specified by:
toADQLin interfaceADQLObject- Overrides:
toADQLin classColumnReference- Returns:
- The corresponding ADQL expression.
-
-