Package adql.query
Class SetOperation
java.lang.Object
adql.query.ADQLSet
adql.query.SetOperation
- All Implemented Interfaces:
ADQLObject
It represents an operation between two rows sets (UNION, EXCEPT, INTERSECT).
- Since:
- 2.0
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSetOperation
(ADQLParser.ADQLVersion version, ADQLSet leftSet, SetOperationType operation, ADQLSet rightSet) Builds a set operation.SetOperation
(ADQLSet leftSet, SetOperationType operation, ADQLSet rightSet) Builds a set operation.SetOperation
(SetOperation toCopy) Builds aSetOperation
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.Get the description of this ADQL's Language Feature.Gets the left set.int
getLimit()
Gets the maximum number of rows imposed in this rows set.getName()
Gets the name of this object in ADQL.Gets the set operation type.DBColumn[]
Gets the list of columns (database metadata) selected by this set operation.Gets the right set.boolean
hasLimit()
Indicates whether this rows set imposes a maximum number of rows.final boolean
Tell whether duplicate rows must be kept.void
setLeftSet
(ADQLSet newLeftSet) Changes the left set of this set operation.void
setLimit
(int limit) Changes the maximum number of rows returned in this rows set.void
Sets no maximum number of rows returned in this rows set.void
setOperation
(SetOperationType newOperation) Changes the type of this set operation (UNION, EXCEPT, INTERSECT).void
setRightSet
(ADQLSet newRightSet) Changes the right set of this set operation.final void
setWithDuplicates
(boolean withDuplicates) toADQL()
Gets the ADQL expression of this object.Methods inherited from class adql.query.ADQLSet
getADQLVersion, getOffset, getOrderBy, getPosition, getWith, reset, search, setOffset, setOrderBy, setPosition, setWith
-
Constructor Details
-
SetOperation
Builds a set operation.- Parameters:
leftSet
- Left set.operation
- Set operation type.rightSet
- Right set.- Throws:
NullPointerException
- If one of the given parameters is NULL.- See Also:
-
SetOperation
public SetOperation(ADQLParser.ADQLVersion version, ADQLSet leftSet, SetOperationType operation, ADQLSet rightSet) Builds a set operation.- Parameters:
version
- Followed version of the ADQL grammar. If NULL, thedefault version
will be set.leftSet
- Left set.operation
- Set operation type.rightSet
- Right set.- Throws:
NullPointerException
- If one of the three last parameters is NULL.- See Also:
-
SetOperation
Builds aSetOperation
by copying the given one.- Parameters:
toCopy
- TheSetOperation
to copy.- Throws:
Exception
- If there is an error during the copy.
-
-
Method Details
-
getName
Description copied from interface:ADQLObject
Gets the name of this object in ADQL.- Returns:
- The name of this ADQL object.
-
getLeftSet
Gets the left set.- Returns:
- The left set.
-
setLeftSet
public void setLeftSet(ADQLSet newLeftSet) throws NullPointerException, UnsupportedOperationException Changes the left set of this set operation.- Parameters:
newLeftSet
- The new left set of this set operation.- Throws:
NullPointerException
- If the given set is NULL.UnsupportedOperationException
-
getOperation
Gets the set operation type.- Returns:
- The set operation type.
- See Also:
-
setOperation
Changes the type of this set operation (UNION, EXCEPT, INTERSECT).- Parameters:
newOperation
- The new type of this set operation.- See Also:
-
isWithDuplicates
public final boolean isWithDuplicates()Tell whether duplicate rows must be kept.- Returns:
true
if duplicates must be preserved,false
otherwise.
-
setWithDuplicates
public final void setWithDuplicates(boolean withDuplicates) - Parameters:
withDuplicates
- the withDuplicates to set
-
getRightSet
Gets the right set.- Returns:
- The right set.
-
setRightSet
public void setRightSet(ADQLSet newRightSet) throws NullPointerException, UnsupportedOperationException Changes the right set of this set operation.- Parameters:
newRightSet
- The new right set of this set operation.- Throws:
NullPointerException
- If the given set is NULL.UnsupportedOperationException
-
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 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 void setLimit(int limit) Description copied from class:ADQLSet
Changes the maximum number of rows returned in this rows set. -
getResultingColumns
Gets the list of columns (database metadata) selected by this set operation.- Specified by:
getResultingColumns
in classADQLSet
- Returns:
- Selected columns metadata.
-
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.
-
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.
-
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.
-