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 LanguageFeature
Get the description of this ADQL's Language Feature.final FromContent
getFrom()
Gets the FROM clause of this query.final ClauseADQL<ADQLOperand>
Gets the GROUP BY clause of this query.final ClauseConstraints
Gets the HAVING clause of this query.int
getLimit()
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 ClauseSelect
Gets the SELECT clause of this query.final ClauseConstraints
getWhere()
Gets the WHERE clause of this query.boolean
hasLimit()
Indicates whether this rows set imposes a maximum number of rows.void
reset()
Clear all the clauses.void
setFrom
(FromContent newFrom) Replaces its FROM clause by the given one.void
setGroupBy
(ClauseADQL<ADQLOperand> newGroupBy) Replaces its GROUP BY clause by the given one.void
setHaving
(ClauseConstraints newHaving) Replaces its HAVING clause by the given one.final void
setLimit
(int limit) Changes the maximum number of rows returned in this rows set.final void
Sets no maximum number of rows returned in this rows set.void
setSelect
(ClauseSelect newSelect) Replaces its SELECT clause by the given one.void
setWhere
(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, thedefault version
will be set.- 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:ADQLObject
Get 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:ADQLSet
Indicates whether this rows set imposes a maximum number of rows. -
getLimit
public int getLimit()Description copied from class:ADQLSet
Gets the maximum number of rows imposed in this rows set. -
setNoLimit
public final void setNoLimit()Description copied from class:ADQLSet
Sets no maximum number of rows returned in this rows set.- Specified by:
setNoLimit
in classADQLSet
-
setLimit
public final void setLimit(int limit) Description copied from class:ADQLSet
Changes the maximum number of rows returned in this rows set. -
getCopy
Description copied from interface:ADQLObject
Gets 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:ADQLObject
Gets 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:
getResultingColumns
in classADQLSet
- Returns:
- Selected columns metadata.
-
adqlIterator
Description copied from interface: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.- Returns:
- An ADQL objects iterator.
- See Also:
-
toADQL
Description copied from interface:ADQLObject
Gets the ADQL expression of this object.- Returns:
- The corresponding ADQL expression.
-