public class Exists extends java.lang.Object implements ADQLConstraint
Represents the predicate EXISTS of SQL and ADQL.
This function returns true if the sub-query given in parameter returns at least one result, else it returns false.
Constructor and Description |
---|
Exists(ADQLQuery query)
Builds an Exists constraint instance.
|
Exists(Exists toCopy)
Builds an Exists constraint by copying the given one.
|
Modifier and Type | Method and Description |
---|---|
ADQLIterator |
adqlIterator()
Gets an iterator on the intern ADQL objects.
|
ADQLObject |
getCopy()
Gets a (deep) copy of this ADQL object.
|
java.lang.String |
getName()
Gets the name of this object in ADQL.
|
TextPosition |
getPosition()
Gets the position of this object/token in the ADQL query.
|
ADQLQuery |
getSubQuery()
Gets the sub-query of this EXISTS constraint.
|
void |
setPosition(TextPosition position)
Set the position of this
Exists in the given ADQL query string. |
void |
setSubQuery(ADQLQuery query)
Replaces the sub-query of this EXISTS constraint by the given one.
|
java.lang.String |
toADQL()
Gets the ADQL expression of this object.
|
public Exists(ADQLQuery query)
query
- Its sub-query.public Exists(Exists toCopy) throws java.lang.Exception
toCopy
- The Exists constraint to copy.java.lang.Exception
- If there is an error during the copy.public final ADQLQuery getSubQuery()
public void setSubQuery(ADQLQuery query) throws java.lang.NullPointerException
query
- Its new sub-query.java.lang.NullPointerException
- If the given query is null.public final TextPosition getPosition()
ADQLObject
Gets the position of this object/token in the ADQL query.
By default, no position should be set.
getPosition
in interface ADQLObject
public final void setPosition(TextPosition position)
Exists
in the given ADQL query string.position
- New position of this Exists
.public ADQLObject getCopy() throws java.lang.Exception
ADQLObject
getCopy
in interface ADQLObject
java.lang.Exception
- If there is any error during the copy.public java.lang.String getName()
ADQLObject
getName
in interface ADQLObject
public ADQLIterator adqlIterator()
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.
adqlIterator
in interface ADQLObject
ADQLIterator
,
ISearchHandler
public java.lang.String toADQL()
ADQLObject
toADQL
in interface ADQLObject