Class ExpressionValue

java.lang.Object
com.luciad.expressions.ExpressionValue
All Implemented Interfaces:
AutoCloseable

public final class ExpressionValue extends Object implements 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 Details Link icon

    • ExpressionValue Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      public ExpressionValue(@NotNull ExpressionValue other)
      Constructs a copy of other.
      Parameters:
      other - Instance of the ExpressionValue.
    • ExpressionValue Link icon

      public ExpressionValue(@NotNull String value)
      Constructs the value object for a text value.

      The type of the value is DataType#getStringType().

      Parameters:
      value - the text.
    • ExpressionValue Link icon

      public ExpressionValue(@NotNull Geometry value)
      Constructs the value object for a Geometry value.

      The type of the value is DataType#getGeometryType().

      Parameters:
      value - Geometry, cannot be null.
  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class Object
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getDataType Link icon

      @NotNull public DataType getDataType()
      Returns the type of the value stored within this value object.
      Returns:
      the type of the value stored within this value object.
    • getFloatValue Link icon

      public float getFloatValue() throws IllegalStateException
      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 Link icon

      public double getDoubleValue() throws IllegalStateException
      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 Link icon

      public int getIntValue() throws IllegalStateException
      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 Link icon

      public long getLongValue() throws IllegalStateException
      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 Link icon

      public boolean getBoolValue() throws IllegalStateException
      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 Link icon

      @NotNull public String getStringValue() throws IllegalStateException
      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 Link icon

      @NotNull public Geometry getGeometryValue() throws IllegalStateException
      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 Link icon

      @Nullable public Double 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 Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals Link icon

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object