Package adql.query.constraint
Class In
java.lang.Object
adql.query.constraint.In
- All Implemented Interfaces:
ADQLObject,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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBuilds a IN constraint by copying the given one.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, ADQLSet query) Builds an IN constraint with a sub-query.In(ADQLOperand op, ADQLSet query, boolean notIn) Builds an IN constraint with a sub-query.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. -
Method Summary
Modifier and TypeMethodDescriptionGets an iterator on the intern ADQL objects.getCopy()Gets a (deep) copy of this ADQL object.final LanguageFeatureGet the description of this ADQL's Language Feature.getName()Gets the name of this object in ADQL.final ADQLOperandGets the left operand of this IN constraint.final TextPositionGets the position of this object/token in the ADQL query.final ADQLSetGets the sub-query (right operand) of this IN constraint.final ADQLList<ADQLOperand> Gets the values list (right operand) of this IN constraint.final booleanTells whether the right operand of this IN constraint is a sub-query or a values list.final booleanisNotIn()Tells whether this predicate is IN or NOT IN.voidsetNotIn(boolean notIn) Lets telling whether this predicate must be IN or NOT IN.voidsetOperand(ADQLOperand newLeftOp) Replaces the left operand of this IN constraint.final voidsetPosition(TextPosition position) Set the position of thisInin the given ADQL query string.voidsetSubQuery(ADQLSet newSubQuery) Replaces the sub-query (right operand) of this IN constraint.voidsetValuesList(ADQLList<ADQLOperand> valuesList) Replaces the values list (right operand) of this IN constraint.voidsetValuesList(ADQLOperand[] valuesList) Replaces the values list (right operand) of this IN constraint.toADQL()Gets the ADQL expression of this object.
-
Field Details
-
FEATURE
Description of this ADQL Feature.- Since:
- 2.0
-
-
Constructor Details
-
In
Builds an IN constraint with a sub-query.- Parameters:
op- The operand whose the value must be in the results of the given sub-query.query- A sub-query.- Throws:
NullPointerException- If the given operand and/or the given sub-query is NULL.
-
In
Builds an IN constraint with a sub-query.- Parameters:
op- The operand whose the value must be in the results of the given sub-query.query- A sub-query.notIn-truefor NOT IN,falsefor IN.- Throws:
NullPointerException- If the given operand and/or the given sub-query is NULL.
-
In
Builds an IN constraint with a values list.- Parameters:
op- The operand whose the value must be in the given values list.valuesList- The values list.- Throws:
NullPointerException- If the given operand is NULL and/or the given list is NULL or empty.
-
In
Builds an IN constraint with a values list.- Parameters:
op- The operand whose the value must be in the given values list.valuesList- The values list.notIn-truefor NOT IN,falsefor IN.- Throws:
NullPointerException- If the given operand is NULL and/or the given list is NULL or empty.
-
In
Builds an IN constraint with a values list.- Parameters:
op- The operand whose the value must be in the given values list.valuesList- The values list.- Throws:
NullPointerException- If the given operand is NULL and/or the given list is NULL or empty.
-
In
public In(ADQLOperand op, ADQLList<ADQLOperand> valuesList, boolean notIn) throws NullPointerException Builds an IN constraint with a values list.- Parameters:
op- The operand whose the value must be in the given values list.valuesList- The values list.notIn-truefor NOT IN,falsefor IN.- Throws:
NullPointerException- If the given operand is NULL and/or the given list is NULL or empty.
-
In
Builds a IN constraint by copying the given one.- Parameters:
toCopy- The IN constraint to copy.- Throws:
Exception- If there is an error during the copy.
-
-
Method Details
-
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.
- Specified by:
getFeatureDescriptionin interfaceADQLObject- Returns:
- Description of this ADQL object as an ADQL's feature.
-
getOperand
Gets the left operand of this IN constraint.- Returns:
- Its left operand.
-
setOperand
Replaces the left operand of this IN constraint.- Parameters:
newLeftOp- Its new left operand.- Throws:
NullPointerException- If the given operand is NULL.
-
getSubQuery
Gets the sub-query (right operand) of this IN constraint.- Returns:
- Its sub-query.
-
hasSubQuery
public final boolean hasSubQuery()Tells whether the right operand of this IN constraint is a sub-query or a values list.- Returns:
trueif the right operand is a sub-query,falsefor a values list (even empty).
-
setSubQuery
Replaces the sub-query (right operand) of this IN constraint.- Parameters:
newSubQuery- Its new sub-query.- Throws:
NullPointerException- If the given sub-query is NULL.
-
getValuesList
Gets the values list (right operand) of this IN constraint.- Returns:
- Its values list.
-
setValuesList
Replaces the values list (right operand) of this IN constraint.- Parameters:
valuesList- Its new values list.- Throws:
NullPointerException- If the given list is NULL.
-
setValuesList
Replaces the values list (right operand) of this IN constraint.- Parameters:
valuesList- Its new values list.- Throws:
NullPointerException- If the given list is NULL.
-
isNotIn
public final boolean isNotIn()Tells whether this predicate is IN or NOT IN.- Returns:
truefor NOT IN,falsefor IN.
-
setNotIn
public void setNotIn(boolean notIn) Lets telling whether this predicate must be IN or NOT IN.- Parameters:
notIn-truefor NOT IN,falsefor IN.
-
getPosition
Description copied from interface:ADQLObjectGets the position of this object/token in the ADQL query.By default, no position should be set.
- Specified by:
getPositionin 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 thisInin the given ADQL query string.- Parameters:
position- New position of thisIn.- Since:
- 1.4
-
getCopy
Description copied from interface:ADQLObjectGets a (deep) copy of this ADQL object.- Specified by:
getCopyin interfaceADQLObject- Returns:
- The copy of this ADQL object.
- Throws:
Exception- If there is any error during the copy.
-
getName
Description copied from interface:ADQLObjectGets the name of this object in ADQL.- Specified by:
getNamein interfaceADQLObject- Returns:
- The name of this ADQL object.
-
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.- Specified by:
adqlIteratorin interfaceADQLObject- Returns:
- An ADQL objects iterator.
- See Also:
-
toADQL
Description copied from interface:ADQLObjectGets the ADQL expression of this object.- Specified by:
toADQLin interfaceADQLObject- Returns:
- The corresponding ADQL expression.
-