public final class NumericConstant extends java.lang.Object implements ADQLOperand
Constructor and Description |
---|
NumericConstant(double val)
The numeric value is saved as a string so that the exact user format can be saved.
|
NumericConstant(long val)
The numeric value is saved as a string so that the exact user format can be saved.
|
NumericConstant(NumericConstant toCopy)
Builds a NumericConstant by copying the given one.
|
NumericConstant(java.lang.String value)
The numeric value is saved as a string so that the exact user format can be saved.
|
NumericConstant(java.lang.String value,
boolean checkNumeric)
The numeric value is saved as a string so that the exact user format can be saved.
|
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.
|
java.lang.String |
getName()
Gets the name of this object in ADQL.
|
double |
getNumericValue() |
java.lang.String |
getValue() |
boolean |
isGeometry()
Always returns false.
|
boolean |
isNumeric()
Always returns true.
|
boolean |
isString()
Always returns false.
|
void |
setValue(double value)
Sets the given value.
|
void |
setValue(long value)
Sets the given value.
|
void |
setValue(java.lang.String value)
Sets the given value (it must be convertible in a Double).
|
void |
setValue(java.lang.String value,
boolean checkNumeric)
Sets the given value.
|
java.lang.String |
toADQL()
Gets the ADQL expression of this object.
|
public NumericConstant(java.lang.String value) throws java.lang.NumberFormatException
value
- The numeric value (in a String variable).java.lang.NumberFormatException
- If it is impossible to convert the given value in a Double.setValue(String)
public NumericConstant(long val)
val
- The numeric value.public NumericConstant(double val)
val
- The numeric value.public NumericConstant(java.lang.String value, boolean checkNumeric) throws java.lang.NumberFormatException
value
- The numeric value (in a String variable).checkNumeric
- true to check whether the given value is numeric, false otherwise.java.lang.NumberFormatException
- If it is impossible to convert the given value in a Double.setValue(String, boolean)
public NumericConstant(NumericConstant toCopy)
toCopy
- The NumericConstant to copy.public final java.lang.String getValue()
public final double getNumericValue()
public final void setValue(long value)
value
- The numeric value.public final void setValue(double value)
value
- The numeric value.public final void setValue(java.lang.String value) throws java.lang.NumberFormatException
value
- The numeric value.java.lang.NumberFormatException
- If it is impossible to convert the given value in a Double.setValue(String, boolean)
public final void setValue(java.lang.String value, boolean checkNumeric) throws java.lang.NumberFormatException
value
- The numeric value.checkNumeric
- true to check whether the given value is numeric, false otherwise.java.lang.NumberFormatException
- If the given value can not be converted in a Double.public final boolean isNumeric()
isNumeric
in interface ADQLOperand
ADQLOperand.isNumeric()
public final boolean isString()
isString
in interface ADQLOperand
ADQLOperand.isString()
public final boolean isGeometry()
isGeometry
in interface ADQLOperand
ADQLOperand.isGeometry()
public ADQLObject getCopy()
ADQLObject
getCopy
in interface ADQLObject
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