Package adql.query.constraint
Class IsNull
- java.lang.Object
-
- adql.query.constraint.IsNull
-
- All Implemented Interfaces:
ADQLObject,ADQLConstraint
public class IsNull extends java.lang.Object implements ADQLConstraint
Represents a comparison between a column to the NULL value.- Version:
- 1.4 (06/2015)
- Author:
- Grégory Mantelet (CDS;ARI)
-
-
Constructor Summary
Constructors Constructor Description IsNull(IsNull toCopy)Builds a IsNull constraint by copying the given one.IsNull(ADQLColumn column)Builds a comparison between the given column and NULL.IsNull(ADQLColumn column, boolean isNot)Builds a comparison between the column and NULL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ADQLIteratoradqlIterator()Gets an iterator on the intern ADQL objects.ADQLColumngetColumn()Gets the column whose the value is compared to NULL.ADQLObjectgetCopy()Gets a (deep) copy of this ADQL object.java.lang.StringgetName()Gets the name of this object in ADQL.TextPositiongetPosition()Gets the position of this object/token in the ADQL query.booleanisNotNull()Tells whether the predicate is IS NULL or IS NOT NULL.voidsetColumn(ADQLColumn column)Lets changing the column whose the value must be compared to NULL.voidsetNotNull(boolean notNull)Lets indicating which predicate must be used (IS NULL or IS NOT NULL).voidsetPosition(TextPosition position)Set the position of thisIsNullin the given ADQL query string.java.lang.StringtoADQL()Gets the ADQL expression of this object.
-
-
-
Constructor Detail
-
IsNull
public IsNull(ADQLColumn column) throws java.lang.NullPointerException
Builds a comparison between the given column and NULL.- Parameters:
column- The column whose the value must be compared to NULL.- Throws:
java.lang.NullPointerException- If the given column is null.
-
IsNull
public IsNull(ADQLColumn column, boolean isNot) throws java.lang.NullPointerException
Builds a comparison between the column and NULL.- Parameters:
column- The column whose the value must be compared to NULL.isNot- true means IS NOT NULL, false means IS NULL.- Throws:
java.lang.NullPointerException- If the given column is null.
-
IsNull
public IsNull(IsNull toCopy) throws java.lang.Exception
Builds a IsNull constraint by copying the given one.- Parameters:
toCopy- The IsNull to copy.- Throws:
java.lang.Exception- If there is an error during the copy.
-
-
Method Detail
-
getColumn
public final ADQLColumn getColumn()
Gets the column whose the value is compared to NULL.- Returns:
- The column compared to NULL.
-
setColumn
public final void setColumn(ADQLColumn column) throws java.lang.NullPointerException
Lets changing the column whose the value must be compared to NULL.- Parameters:
column- The new column to compare to NULL.- Throws:
java.lang.NullPointerException- If the given column is null.
-
isNotNull
public final boolean isNotNull()
Tells whether the predicate is IS NULL or IS NOT NULL.- Returns:
- true for IS NOT NULL, false for IS NULL.
-
setNotNull
public final void setNotNull(boolean notNull)
Lets indicating which predicate must be used (IS NULL or IS NOT NULL).- Parameters:
notNull- true for IS NOT NULL, false for IS NULL.
-
getPosition
public final TextPosition 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
public final void setPosition(TextPosition position)
Set the position of thisIsNullin the given ADQL query string.- Parameters:
position- New position of thisIsNull.- Since:
- 1.4
-
getCopy
public ADQLObject getCopy() throws java.lang.Exception
Description copied from interface:ADQLObjectGets a (deep) copy of this ADQL object.- Specified by:
getCopyin interfaceADQLObject- Returns:
- The copy of this ADQL object.
- Throws:
java.lang.Exception- If there is any error during the copy.
-
getName
public java.lang.String 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
public ADQLIterator 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:
ADQLIterator,ISearchHandler
-
toADQL
public java.lang.String toADQL()
Description copied from interface:ADQLObjectGets the ADQL expression of this object.- Specified by:
toADQLin interfaceADQLObject- Returns:
- The corresponding ADQL expression.
-
-