Package com.luciad.expressions
Class ExpressionValue
java.lang.Object
com.luciad.expressions.ExpressionValue
- All Implemented Interfaces:
AutoCloseable
Value object to store the value of an
Expression and its DataType.
Users of this value object always must check the type of value stored and then call the appropriate method to retrieve the actual value.
-
Constructor Summary
ConstructorsConstructorDescriptionExpressionValue(boolean value) Constructs the value object for a boolean value.ExpressionValue(double value) Constructs the value object for a number value.ExpressionValue(float value) Constructs the value object for a number value.ExpressionValue(int value) Constructs the value object for an integer value.ExpressionValue(long value) Constructs the value object for a long integer (64 bit) value.ExpressionValue(ExpressionValue other) Constructs a copy of other.ExpressionValue(Geometry value) Constructs the value object for aGeometryvalue.ExpressionValue(String value) Constructs the value object for a text value. -
Method Summary
Modifier and TypeMethodDescriptionasDouble()Returns the double value, if the value object can be converted to a double.voidclose()booleanprotected voidfinalize()booleanReturns the boolean value, if the value object contains a boolean.Returns the type of the value stored within this value object.doubleReturns the double value, if the value object contains a double.floatReturns the float value, if the value object contains a float.Returns the geometry value, if the value object contains a geometry.intReturns the int value, if the value object contains an int.longReturns the long integer value, if the value object contains a long int.Returns the string value, if the value object contains a string.inthashCode()
-
Constructor Details
-
ExpressionValue
public ExpressionValue(float value) Constructs the value object for a number value.The type of the value is
DataType#getFloatType().- Parameters:
value- the number.
-
ExpressionValue
public ExpressionValue(double value) Constructs the value object for a number value.The type of the value is
DataType#getDoubleType().- Parameters:
value- the number.
-
ExpressionValue
public ExpressionValue(int value) Constructs the value object for an integer value.The type of the value is
DataType#getIntType().- Parameters:
value- the number.
-
ExpressionValue
public ExpressionValue(long value) Constructs the value object for a long integer (64 bit) value.The type of the value is
DataType#getLongType().- Parameters:
value- the number.
-
ExpressionValue
public ExpressionValue(boolean value) Constructs the value object for a boolean value.The type of the value is
DataType#getBooleanType().- Parameters:
value- the boolean.
-
ExpressionValue
Constructs a copy of other.- Parameters:
other- Instance of theExpressionValue.
-
ExpressionValue
Constructs the value object for a text value.The type of the value is
DataType#getStringType().- Parameters:
value- the text.
-
ExpressionValue
Constructs the value object for aGeometryvalue.The type of the value is
DataType#getGeometryType().- Parameters:
value-Geometry, cannot benull.
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getDataType
Returns the type of the value stored within this value object.- Returns:
- the type of the value stored within this value object.
-
getFloatValue
Returns the float value, if the value object contains a float.- Returns:
- the float value, if the value object contains a float.
- Throws:
IllegalStateException- when the object does not contain a float.
-
getDoubleValue
Returns the double value, if the value object contains a double.- Returns:
- the double value, if the value object contains a double.
- Throws:
IllegalStateException- when the object does not contain a double.
-
getIntValue
Returns the int value, if the value object contains an int.- Returns:
- the int value, if the value object contains an int.
- Throws:
IllegalStateException- when the object does not contain an int.
-
getLongValue
Returns the long integer value, if the value object contains a long int.- Returns:
- the long integer value, if the value object contains a long int.
- Throws:
IllegalStateException- when the object does not contain a long int.
-
getBoolValue
Returns the boolean value, if the value object contains a boolean.- Returns:
- the boolean value, if the value object contains a boolean.
- Throws:
IllegalStateException- when the object does not contain a boolean.
-
getStringValue
Returns the string value, if the value object contains a string.- Returns:
- the string value, if the value object contains a string.
- Throws:
IllegalStateException- when the object does not contain a string.
-
getGeometryValue
Returns the geometry value, if the value object contains a geometry.- Returns:
- the geometry value, if the value object contains a geometry.
- Throws:
IllegalStateException- when the object does not contain a geometry.
-
asDouble
Returns the double value, if the value object can be converted to a double.- Returns:
- the double value, if the value object can be converted to a double.
-
hashCode
public int hashCode() -
equals
-