Package adql.query
Class ADQLSet
java.lang.Object
adql.query.ADQLSet
- All Implemented Interfaces:
ADQLObject
- Direct Known Subclasses:
ADQLQuery
,SetOperation
Object representation of an ADQL's rows set.
The resulting object of the ADQLParser
is an object of this class.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ADQLParser.ADQLVersion
Version of the ADQL grammar in which this query is written.protected ClauseOffset
The ADQL clause OFFSET.protected ClauseADQL<ADQLOrder>
The ADQL clause ORDER BY.protected TextPosition
Position of this Query (or sub-query) inside the whole given ADQL query string.protected ClauseADQL<WithItem>
The ADQL clause WITH. -
Constructor Summary
ConstructorsConstructorDescriptionADQLSet()
Builds an empty ADQL set.ADQLSet
(ADQLParser.ADQLVersion version) Builds an empty ADQL set following the specified ADQL grammar.Builds an ADQL set by copying the given one. -
Method Summary
Modifier and TypeMethodDescriptionfinal ADQLParser.ADQLVersion
Get the followed version of the ADQL grammar.abstract int
getLimit()
Gets the maximum number of rows imposed in this rows set.final ClauseOffset
Gets the OFFSET value of this rows set.final ClauseADQL<ADQLOrder>
Gets the ORDER BY clause of this rows set.Gets the position of this object/token in the ADQL query.abstract DBColumn[]
final ClauseADQL<WithItem>
getWith()
Gets the WITH clause of this query.abstract boolean
hasLimit()
Indicates whether this rows set imposes a maximum number of rows.void
reset()
Clear all the clauses.search
(ISearchHandler sHandler) Lets searching ADQL objects into this rows set thanks to the given search handler.abstract void
setLimit
(int limit) Changes the maximum number of rows returned in this rows set.abstract void
Sets no maximum number of rows returned in this rows set.void
setOffset
(ClauseOffset newOffset) Replaces its OFFSET value by the given one.void
setOrderBy
(ClauseADQL<ADQLOrder> newOrderBy) Replaces its ORDER BY clause by the given one.final void
setPosition
(TextPosition position) Set the position of thisADQLSet
inside the whole given ADQL query string.void
setWith
(ClauseADQL<WithItem> newWith) Replaces its WITH clause by the given one.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface adql.query.ADQLObject
adqlIterator, getCopy, getFeatureDescription, getName, toADQL
-
Field Details
-
adqlVersion
Version of the ADQL grammar in which this query is written. -
with
The ADQL clause WITH. -
orderBy
The ADQL clause ORDER BY. -
offset
The ADQL clause OFFSET. -
position
Position of this Query (or sub-query) inside the whole given ADQL query string.
-
-
Constructor Details
-
ADQLSet
public ADQLSet()Builds an empty ADQL set. -
ADQLSet
Builds an empty ADQL set following the specified ADQL grammar.- Parameters:
version
- Followed version of the ADQL grammar. If NULL, thedefault version
will be set.
-
ADQLSet
Builds an ADQL set by copying the given one.- Parameters:
toCopy
- The ADQL set to copy.- Throws:
Exception
- If there is an error during the copy.
-
-
Method Details
-
getADQLVersion
Get the followed version of the ADQL grammar.- Returns:
- The followed ADQL grammar version.
-
reset
public void reset()Clear all the clauses. -
getWith
Gets the WITH clause of this query.- Returns:
- Its WITH clause.
-
setWith
Replaces its WITH clause by the given one.Note: The position of the query is erased.
- Parameters:
newWith
- The new WITH clause.- Throws:
NullPointerException
- If the given WITH clause is NULL.
-
getOrderBy
Gets the ORDER BY clause of this rows set.- Returns:
- Its ORDER BY clause.
-
setOrderBy
Replaces its ORDER BY clause by the given one.Note: The position inside the query is erased.
- Parameters:
newOrderBy
- The new ORDER BY clause.- Throws:
NullPointerException
- If the given ORDER BY clause is NULL.
-
hasLimit
public abstract boolean hasLimit()Indicates whether this rows set imposes a maximum number of rows.- Returns:
true
this clause has a limited number of rows,false
otherwise.
-
getLimit
public abstract int getLimit()Gets the maximum number of rows imposed in this rows set.- Returns:
- Maximum number of rows the query must return.
-
setNoLimit
public abstract void setNoLimit()Sets no maximum number of rows returned in this rows set. -
setLimit
public abstract void setLimit(int limit) Changes the maximum number of rows returned in this rows set.- Parameters:
limit
- The maximum number of returned rows.
-
getOffset
Gets the OFFSET value of this rows set.- Returns:
- Its OFFSET value, or NULL if not OFFSET is set.
-
setOffset
Replaces its OFFSET value by the given one.Note: The position inside the query is erased.
- Parameters:
newOffset
- The new OFFSET value, or NULL to remove the current OFFSET.
-
getPosition
Description copied from interface:ADQLObject
Gets the position of this object/token in the ADQL query.By default, no position should be set.
- Specified by:
getPosition
in interfaceADQLObject
- Returns:
- Position of this ADQL item in the ADQL query, or NULL if not written originally in the query (for example, if added afterwards).
-
setPosition
Set the position of thisADQLSet
inside the whole given ADQL query string.- Parameters:
position
- New position of thisADQLSet
.
-
getResultingColumns
-
search
Lets searching ADQL objects into this rows set thanks to the given search handler.- Parameters:
sHandler
- A search handler.- Returns:
- An iterator on all ADQL objects found.
-