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 aSetOperationby 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.intgetLimit()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.booleanhasLimit()Indicates whether this rows set imposes a maximum number of rows.final booleanTell whether duplicate rows must be kept.voidsetLeftSet(ADQLSet newLeftSet) Changes the left set of this set operation.voidsetLimit(int limit) Changes the maximum number of rows returned in this rows set.voidSets no maximum number of rows returned in this rows set.voidsetOperation(SetOperationType newOperation) Changes the type of this set operation (UNION, EXCEPT, INTERSECT).voidsetRightSet(ADQLSet newRightSet) Changes the right set of this set operation.final voidsetWithDuplicates(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 versionwill 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 aSetOperationby copying the given one.- Parameters:
toCopy- TheSetOperationto copy.- Throws:
Exception- If there is an error during the copy.
-
-
Method Details
-
getName
Description copied from interface:ADQLObjectGets 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:
trueif duplicates must be preserved,falseotherwise.
-
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: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 void setNoLimit()Description copied from class:ADQLSetSets no maximum number of rows returned in this rows set.- Specified by:
setNoLimitin classADQLSet
-
setLimit
public void setLimit(int limit) Description copied from class:ADQLSetChanges 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:
getResultingColumnsin classADQLSet- Returns:
- Selected columns metadata.
-
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.
-
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.
-
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.
-