public class In extends java.lang.Object implements ADQLConstraint
It represents the IN predicate of SQL and ADQL.
This predicate returns true if the value of the given operand is either in the given values list or in the results of the given sub-query, else it returns false.
Constructor and Description |
---|
In(ADQLOperand op,
ADQLList<ADQLOperand> valuesList)
Builds an IN constraint with a values list.
|
In(ADQLOperand op,
ADQLList<ADQLOperand> valuesList,
boolean notIn)
Builds an IN constraint with a values list.
|
In(ADQLOperand op,
ADQLOperand[] valuesList)
Builds an IN constraint with a values list.
|
In(ADQLOperand op,
ADQLOperand[] valuesList,
boolean notIn)
Builds an IN constraint with a values list.
|
In(ADQLOperand op,
ADQLQuery query)
Builds an IN constraint with a sub-query.
|
In(ADQLOperand op,
ADQLQuery query,
boolean notIn)
Builds an IN constraint with a sub-query.
|
In(In toCopy)
Builds a IN 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.
|
ADQLOperand |
getOperand()
Gets the left operand of this IN constraint.
|
TextPosition |
getPosition()
Gets the position of this object/token in the ADQL query.
|
ADQLQuery |
getSubQuery()
Gets the sub-query (right operand) of this IN constraint.
|
ADQLList<ADQLOperand> |
getValuesList()
Gets the values list (right operand) of this IN constraint.
|
boolean |
hasSubQuery()
Tells whether the right operand of this IN constraint is a sub-query or a values list.
|
boolean |
isNotIn()
Tells whether this predicate is IN or NOT IN.
|
void |
setNotIn(boolean notIn)
Lets telling whether this predicate must be IN or NOT IN.
|
void |
setOperand(ADQLOperand newLeftOp)
Replaces the left operand of this IN constraint.
|
void |
setPosition(TextPosition position)
Set the position of this
In in the given ADQL query string. |
void |
setSubQuery(ADQLQuery newSubQuery)
Replaces the sub-query (right operand) of this IN constraint.
|
void |
setValuesList(ADQLList<ADQLOperand> valuesList)
Replaces the values list (right operand) of this IN constraint.
|
void |
setValuesList(ADQLOperand[] valuesList)
Replaces the values list (right operand) of this IN constraint.
|
java.lang.String |
toADQL()
Gets the ADQL expression of this object.
|
public In(ADQLOperand op, ADQLQuery query) throws java.lang.NullPointerException
op
- The operand whose the value must be in the results of the given sub-query.query
- A sub-query.java.lang.NullPointerException
- If the given operand and/or the given sub-query is null.public In(ADQLOperand op, ADQLQuery query, boolean notIn) throws java.lang.NullPointerException
op
- The operand whose the value must be in the results of the given sub-query.query
- A sub-query.notIn
- true for NOT IN, false for IN.java.lang.NullPointerException
- If the given operand and/or the given sub-query is null.public In(ADQLOperand op, ADQLOperand[] valuesList) throws java.lang.NullPointerException
op
- The operand whose the value must be in the given values list.valuesList
- The values list.java.lang.NullPointerException
- If the given operand is null and/or the given list is null or empty.public In(ADQLOperand op, ADQLOperand[] valuesList, boolean notIn) throws java.lang.NullPointerException
op
- The operand whose the value must be in the given values list.valuesList
- The values list.notIn
- true for NOT IN, false for IN.java.lang.NullPointerException
- If the given operand is null and/or the given list is null or empty.public In(ADQLOperand op, ADQLList<ADQLOperand> valuesList) throws java.lang.NullPointerException
op
- The operand whose the value must be in the given values list.valuesList
- The values list.java.lang.NullPointerException
- If the given operand is null and/or the given list is null or empty.public In(ADQLOperand op, ADQLList<ADQLOperand> valuesList, boolean notIn) throws java.lang.NullPointerException
op
- The operand whose the value must be in the given values list.valuesList
- The values list.notIn
- true for NOT IN, false for IN.java.lang.NullPointerException
- If the given operand is null and/or the given list is null or empty.public In(In toCopy) throws java.lang.Exception
toCopy
- The IN constraint to copy.java.lang.Exception
- If there is an error during the copy.public final ADQLOperand getOperand()
public void setOperand(ADQLOperand newLeftOp) throws java.lang.NullPointerException
newLeftOp
- Its new left operand.java.lang.NullPointerException
- If the given operand is null.public final ADQLQuery getSubQuery()
public final boolean hasSubQuery()
public void setSubQuery(ADQLQuery newSubQuery) throws java.lang.NullPointerException
newSubQuery
- Its new sub-query.java.lang.NullPointerException
- If the given sub-query is null.public final ADQLList<ADQLOperand> getValuesList()
public void setValuesList(ADQLOperand[] valuesList) throws java.lang.NullPointerException
valuesList
- Its new values list.java.lang.NullPointerException
- If the given list is null.public void setValuesList(ADQLList<ADQLOperand> valuesList) throws java.lang.NullPointerException
valuesList
- Its new values list.java.lang.NullPointerException
- If the given list is null.public final boolean isNotIn()
public void setNotIn(boolean notIn)
notIn
- true for NOT IN, false for IN.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)
In
in the given ADQL query string.position
- New position of this In
.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