public final class ExpressionValue extends Object implements AutoCloseable
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 and Description |
---|
ExpressionValue(boolean value)
Constructs the value object for a boolean value.
|
ExpressionValue(double value)
Constructs the value object for a number value.
|
ExpressionValue(ExpressionValue other)
Constructs a copy of other.
|
ExpressionValue(float value)
Constructs the value object for a number value.
|
ExpressionValue(Geometry value)
Constructs the value object for a
Geometry 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(String value)
Constructs the value object for a text value.
|
Modifier and Type | Method and Description |
---|---|
Double |
asDouble()
Returns the double value, if the value object can be converted to a double.
|
void |
close() |
boolean |
equals(Object other) |
protected void |
finalize() |
boolean |
getBoolValue()
Returns the boolean value, if the value object contains a boolean.
|
DataType |
getDataType()
Returns the type of the value stored within this value object.
|
double |
getDoubleValue()
Returns the double value, if the value object contains a double.
|
float |
getFloatValue()
Returns the float value, if the value object contains a float.
|
Geometry |
getGeometryValue()
Returns the geometry value, if the value object contains a geometry.
|
int |
getIntValue()
Returns the int value, if the value object contains an int.
|
long |
getLongValue()
Returns the long integer value, if the value object contains a long int.
|
String |
getStringValue()
Returns the string value, if the value object contains a string.
|
int |
hashCode() |
public ExpressionValue(float value)
The type of the value is DataType#getFloatType()
.
value
- the number.public ExpressionValue(double value)
The type of the value is DataType#getDoubleType()
.
value
- the number.public ExpressionValue(int value)
The type of the value is DataType#getIntType()
.
value
- the number.public ExpressionValue(long value)
The type of the value is DataType#getLongType()
.
value
- the number.public ExpressionValue(boolean value)
The type of the value is DataType#getBooleanType()
.
value
- the boolean.public ExpressionValue(@NotNull ExpressionValue other)
other
- Instance of the ExpressionValue
.public ExpressionValue(@NotNull String value)
The type of the value is DataType#getStringType()
.
value
- the text.public ExpressionValue(@NotNull Geometry value)
Geometry
value.
The type of the value is DataType#getGeometryType()
.
value
- Geometry
, cannot be null
.public void close()
close
in interface AutoCloseable
@NotNull public DataType getDataType()
public float getFloatValue() throws IllegalStateException
IllegalStateException
- when the object does not contain a float.public double getDoubleValue() throws IllegalStateException
IllegalStateException
- when the object does not contain a double.public int getIntValue() throws IllegalStateException
IllegalStateException
- when the object does not contain an int.public long getLongValue() throws IllegalStateException
IllegalStateException
- when the object does not contain a long int.public boolean getBoolValue() throws IllegalStateException
IllegalStateException
- when the object does not contain a boolean.@NotNull public String getStringValue() throws IllegalStateException
IllegalStateException
- when the object does not contain a string.@NotNull public Geometry getGeometryValue() throws IllegalStateException
IllegalStateException
- when the object does not contain a geometry.@Nullable public Double asDouble()