Package adql.query
Class ADQLQuery
java.lang.Object
adql.query.ADQLSet
adql.query.ADQLQuery
- All Implemented Interfaces:
ADQLObject
Object representation of an ADQL query or sub-query.
The resulting object of the ADQLParser is an object of this class
if no set operation is performed.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBuilds an empty ADQL query.ADQLQuery(ADQLParser.ADQLVersion version) Builds an empty ADQL query following the specified ADQL grammar.Builds an ADQL query by copying the given one. -
Method Summary
Modifier and TypeMethodDescriptionGets an iterator on the intern ADQL objects.getCopy()Gets a (deep) copy of this ADQL object.final LanguageFeatureGet the description of this ADQL's Language Feature.final FromContentgetFrom()Gets the FROM clause of this query.final ClauseADQL<ADQLOperand> Gets the GROUP BY clause of this query.final ClauseConstraintsGets the HAVING clause of this query.intgetLimit()Gets the maximum number of rows imposed in this rows set.getName()Gets the name of this object in ADQL.DBColumn[]Gets the list of columns (database metadata) selected by this query.final ClauseSelectGets the SELECT clause of this query.final ClauseConstraintsgetWhere()Gets the WHERE clause of this query.booleanhasLimit()Indicates whether this rows set imposes a maximum number of rows.voidreset()Clear all the clauses.voidsetFrom(FromContent newFrom) Replaces its FROM clause by the given one.voidsetGroupBy(ClauseADQL<ADQLOperand> newGroupBy) Replaces its GROUP BY clause by the given one.voidsetHaving(ClauseConstraints newHaving) Replaces its HAVING clause by the given one.final voidsetLimit(int limit) Changes the maximum number of rows returned in this rows set.final voidSets no maximum number of rows returned in this rows set.voidsetSelect(ClauseSelect newSelect) Replaces its SELECT clause by the given one.voidsetWhere(ClauseConstraints newWhere) Replaces its WHERE clause by the given one.toADQL()Gets the ADQL expression of this object.Methods inherited from class adql.query.ADQLSet
getADQLVersion, getOffset, getOrderBy, getPosition, getWith, search, setOffset, setOrderBy, setPosition, setWith
-
Field Details
-
FEATURE
Description of this ADQL Feature.- Since:
- 2.0
-
-
Constructor Details
-
ADQLQuery
public ADQLQuery()Builds an empty ADQL query. -
ADQLQuery
Builds an empty ADQL query following the specified ADQL grammar.- Parameters:
version- Followed version of the ADQL grammar. If NULL, thewill be set.invalid reference
default version- Since:
- 2.0
-
ADQLQuery
Builds an ADQL query by copying the given one.- Parameters:
toCopy- The ADQL query to copy.- Throws:
Exception- If there is an error during the copy.
-
-
Method Details
-
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.
- Returns:
- Description of this ADQL object as an ADQL's feature.
-
reset
public void reset()Clear all the clauses. -
getSelect
Gets the SELECT clause of this query.- Returns:
- Its SELECT clause.
-
setSelect
Replaces its SELECT clause by the given one.Note: The position of the query is erased.
- Parameters:
newSelect- The new SELECT clause.- Throws:
NullPointerException- If the given SELECT clause is NULL.
-
getFrom
Gets the FROM clause of this query.- Returns:
- Its FROM clause.
-
setFrom
Replaces its FROM clause by the given one.Note: The position of the query is erased.
- Parameters:
newFrom- The new FROM clause.- Throws:
NullPointerException- If the given FROM clause is NULL.
-
getWhere
Gets the WHERE clause of this query.- Returns:
- Its WHERE clause.
-
setWhere
Replaces its WHERE clause by the given one.Note: The position of the query is erased.
- Parameters:
newWhere- The new WHERE clause.- Throws:
NullPointerException- If the given WHERE clause is NULL.
-
getGroupBy
Gets the GROUP BY clause of this query.- Returns:
- Its GROUP BY clause.
-
setGroupBy
Replaces its GROUP BY clause by the given one.Note: The position of the query is erased.
- Parameters:
newGroupBy- The new GROUP BY clause.- Throws:
NullPointerException- If the given GROUP BY clause is NULL.
-
getHaving
Gets the HAVING clause of this query.- Returns:
- Its HAVING clause.
-
setHaving
Replaces its HAVING clause by the given one.Note: The position of the query is erased.
- Parameters:
newHaving- The new HAVING clause.- Throws:
NullPointerException- If the given HAVING clause is NULL.
-
hasLimit
public boolean hasLimit()Description copied from class:ADQLSetIndicates whether this rows set imposes a maximum number of rows. -
getLimit
public int getLimit()Description copied from class:ADQLSetGets the maximum number of rows imposed in this rows set. -
setNoLimit
public final void setNoLimit()Description copied from class:ADQLSetSets no maximum number of rows returned in this rows set.- Specified by:
setNoLimitin classADQLSet
-
setLimit
public final void setLimit(int limit) Description copied from class:ADQLSetChanges the maximum number of rows returned in this rows set. -
getCopy
Description copied from interface:ADQLObjectGets a (deep) copy of this ADQL object.- 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.- Returns:
- The name of this ADQL object.
-
getResultingColumns
Gets the list of columns (database metadata) selected by this query.Note: The list is generated on the fly!
- Specified by:
getResultingColumnsin classADQLSet- Returns:
- Selected columns metadata.
-
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.- Returns:
- An ADQL objects iterator.
- See Also:
-
toADQL
Description copied from interface:ADQLObjectGets the ADQL expression of this object.- Returns:
- The corresponding ADQL expression.
-