public class Comparison extends java.lang.Object implements ADQLConstraint
ComparisonOperator
Constructor and Description |
---|
Comparison(ADQLOperand left,
ComparisonOperator comp,
ADQLOperand right)
Creates a comparison between two operands.
|
Comparison(Comparison toCopy)
Builds a comparison 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 part of the comparison.
|
java.lang.String |
getName()
Gets the name of this object in ADQL.
|
ComparisonOperator |
getOperator()
Gets the comparison symbol.
|
TextPosition |
getPosition()
Gets the position of this object/token in the ADQL query.
|
ADQLOperand |
getRightOperand()
Gets the right part of the comparison.
|
void |
setLeftOperand(ADQLOperand newLeftOperand)
Changes the left operand of this comparison.
|
void |
setOperation(ComparisonOperator newOperation)
Changes the type of this operation.
|
void |
setPosition(TextPosition position)
Set the position of this
Comparison in the given ADQL query string. |
void |
setRightOperand(ADQLOperand newRightOperand)
Changes the right operand of this comparison.
|
java.lang.String |
toADQL()
Gets the ADQL expression of this object.
|
public Comparison(ADQLOperand left, ComparisonOperator comp, ADQLOperand right) throws java.lang.NullPointerException, java.lang.UnsupportedOperationException
left
- The left part.comp
- The comparison symbol.right
- The right part.java.lang.NullPointerException
- If one of the given parameter is null.java.lang.UnsupportedOperationException
- If the type of operands and of the operator are incompatibles.setLeftOperand(ADQLOperand)
,
setRightOperand(ADQLOperand)
public Comparison(Comparison toCopy) throws java.lang.Exception
toCopy
- The comparison to copy.java.lang.Exception
- If there is an error during the copy.public final ADQLOperand getLeftOperand()
public void setLeftOperand(ADQLOperand newLeftOperand) throws java.lang.NullPointerException, java.lang.UnsupportedOperationException
newLeftOperand
- The new left operand.java.lang.NullPointerException
- If the given operand is null.java.lang.UnsupportedOperationException
- If the type of the given operand is incompatible with the right operand and/or with the comparison operator.public ComparisonOperator getOperator()
public void setOperation(ComparisonOperator newOperation) throws java.lang.NullPointerException, java.lang.UnsupportedOperationException
newOperation
- The new operation type.java.lang.NullPointerException
- If the given type is null.java.lang.UnsupportedOperationException
- If the given type is incompatible with the two operands.public ADQLOperand getRightOperand()
public void setRightOperand(ADQLOperand newRightOperand) throws java.lang.NullPointerException, java.lang.UnsupportedOperationException
newRightOperand
- The new right operand.java.lang.NullPointerException
- If the given operand is null.java.lang.UnsupportedOperationException
- If the type of the given operand is incompatible with the left operand and/or with the comparison operator.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)
Comparison
in the given ADQL query string.position
- New position of this Comparison
.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