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 ADQLIterator
adqlIterator()
Gets an iterator on the intern ADQL objects.ADQLColumn
getColumn()
Gets the column whose the value is compared to NULL.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.boolean
isNotNull()
Tells whether the predicate is IS NULL or IS NOT NULL.void
setColumn(ADQLColumn column)
Lets changing the column whose the value must be compared to NULL.void
setNotNull(boolean notNull)
Lets indicating which predicate must be used (IS NULL or IS NOT NULL).void
setPosition(TextPosition position)
Set the position of thisIsNull
in the given ADQL query string.java.lang.String
toADQL()
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:ADQLObject
Gets the position of this object/token in the ADQL query.
By default, no position should be set.
- Specified by:
getPosition
in 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 thisIsNull
in 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:ADQLObject
Gets a (deep) copy of this ADQL object.- Specified by:
getCopy
in 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:ADQLObject
Gets the name of this object in ADQL.- Specified by:
getName
in interfaceADQLObject
- Returns:
- The name of this ADQL object.
-
adqlIterator
public ADQLIterator adqlIterator()
Description copied from interface: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.- Specified by:
adqlIterator
in interfaceADQLObject
- Returns:
- An ADQL objects iterator.
- See Also:
ADQLIterator
,ISearchHandler
-
toADQL
public java.lang.String toADQL()
Description copied from interface:ADQLObject
Gets the ADQL expression of this object.- Specified by:
toADQL
in interfaceADQLObject
- Returns:
- The corresponding ADQL expression.
-
-