public class Between extends java.lang.Object implements ADQLConstraint
It represents the BETWEEN predicate of SQL and ADQL.
This predicate returns true if the value of the left operand is between the value of the two other operands, else it returns false.
Constructor and Description |
---|
Between(ADQLOperand operand,
ADQLOperand min,
ADQLOperand max)
Builds a BETWEEN constraints.
|
Between(ADQLOperand operand,
ADQLOperand min,
ADQLOperand max,
boolean notBetween)
Builds a BETWEEN constraints.
|
Between(Between toCopy)
Builds a BETWEEN 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.
|
ADQLOperand |
getLeftOperand()
Gets the left operand of this BETWEEN constraint.
|
ADQLOperand |
getMaxOperand()
Gets the operand which represents the maximum value.
|
ADQLOperand |
getMinOperand()
Gets the operand which represents the minimum value.
|
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 |
isNotBetween()
Tells whether the predicate is BETWEEN or NOT BETWEEN.
|
void |
setLeftOperand(ADQLOperand leftOperand)
Replaces the left operand of this BETWEEN constraint.
|
void |
setMaxOperand(ADQLOperand maxOperand)
Replaces the operand which represents the maximum value.
|
void |
setMinOperand(ADQLOperand minOperand)
Replaces the operand which represents the minimum value.
|
void |
setNotBetween(boolean notBetween)
Lets indicating the predicate to use (BETWEEN or NOT BETWEEN).
|
void |
setPosition(TextPosition position)
Set the position of this
Between in the given ADQL query string. |
java.lang.String |
toADQL()
Gets the ADQL expression of this object.
|
public Between(ADQLOperand operand, ADQLOperand min, ADQLOperand max) throws java.lang.NullPointerException
operand
- The left operand (left part of the BETWEEN predicate).min
- The operand which represents the minimum value.max
- The operand which represents the maximum value.java.lang.NullPointerException
- If one of the given parameters is null.public Between(ADQLOperand operand, ADQLOperand min, ADQLOperand max, boolean notBetween) throws java.lang.NullPointerException
operand
- The left operand (left part of the BETWEEN predicate).min
- The operand which represents the minimum value.max
- The operand which represents the maximum value.notBetween
- true if the predicate NOT BETWEEN must be used or false for BETWEEN.java.lang.NullPointerException
- If one of the given parameters is null.public Between(Between toCopy) throws java.lang.Exception
toCopy
- The BETWEEN constraint to copy.java.lang.Exception
- If there is an error during the copy.public final ADQLOperand getLeftOperand()
public void setLeftOperand(ADQLOperand leftOperand) throws java.lang.NullPointerException
leftOperand
- Its new left operand.java.lang.NullPointerException
- If the given operand is null.public final ADQLOperand getMinOperand()
public void setMinOperand(ADQLOperand minOperand) throws java.lang.NullPointerException
minOperand
- Its new minimum value.java.lang.NullPointerException
- If the given operand is null.public final ADQLOperand getMaxOperand()
public void setMaxOperand(ADQLOperand maxOperand) throws java.lang.NullPointerException
maxOperand
- Its new maximum value.java.lang.NullPointerException
- If the given operand is null.public final boolean isNotBetween()
public void setNotBetween(boolean notBetween)
notBetween
- true for NOT BETWEEN, false for BETWEEN.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)
Between
in the given ADQL query string.position
- New position of this Between
.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