org.encog.ml.prg.expvalue

## Class ExpressionValue

- java.lang.Object
- - org.encog.ml.prg.expvalue.ExpressionValue

- All Implemented Interfaces:
    Serializable

      public class ExpressionValue
      extends Object
      implements Serializable

  An EncogProgram expression value. These is how Encog stores variables and calculates values.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExpressionValue(boolean theValue)` Construct a boolean expression.
    `ExpressionValue(double theValue)` Construct a boolean expression.
    `ExpressionValue(ExpressionValue other)` Construct a expression based on an expression.
    `ExpressionValue(int enumType, long theValue)` Construct an enum expression.
    `ExpressionValue(long theValue)` Construct an integer expression.
    `ExpressionValue(String theValue)` Construct a string expression.
    `ExpressionValue(ValueType theType)` Construct a value of the specified type.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getEnumType()`
    `ValueType` | `getExpressionType()`
    `boolean` | `isBoolean()`
    `boolean` | `isEnum()`
    `boolean` | `isFloat()`
    `boolean` | `isInt()`
    `boolean` | `isNumeric()`
    `boolean` | `isString()`
    `boolean` | `toBooleanValue()`
    `double` | `toFloatValue()`
    `long` | `toIntValue()`
    `String` | `toString()`
    `String` | `toStringValue()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ExpressionValue

          public ExpressionValue(boolean theValue)

      Construct a boolean expression.
      Parameters:
        `theValue` - The value to construct.

    - #### ExpressionValue

          public ExpressionValue(double theValue)

      Construct a boolean expression.
      Parameters:
        `theValue` - The value to construct.

    - #### ExpressionValue

          public ExpressionValue(ExpressionValue other)

      Construct a expression based on an expression.
      Parameters:
        `other` - The value to construct.

    - #### ExpressionValue

          public ExpressionValue(int enumType,
                         long theValue)

      Construct an enum expression.
      Parameters:
        `theValue` - The value to construct.

    - #### ExpressionValue

          public ExpressionValue(long theValue)

      Construct an integer expression.
      Parameters:
        `theValue` - The value to construct.

    - #### ExpressionValue

          public ExpressionValue(String theValue)

      Construct a string expression.
      Parameters:
        `theValue` - The value to construct.

    - #### ExpressionValue

          public ExpressionValue(ValueType theType)

      Construct a value of the specified type.
      Parameters:
        `theType` - The value to construct.

  - ### Method Detail

    - #### getEnumType

          public int getEnumType()

      Returns:
        the enumType

    - #### getExpressionType

          public ValueType getExpressionType()

      Returns:
        The expression type.

    - #### isBoolean

          public boolean isBoolean()

      Returns:
        True, if this is a boolean.

    - #### isEnum

          public boolean isEnum()

      Returns:
        True, if this is an enum.

    - #### isFloat

          public boolean isFloat()

      Returns:
        True, if this is a float.

    - #### isInt

          public boolean isInt()

      Returns:
        True, if this is an int.

    - #### isNumeric

          public boolean isNumeric()

      Returns:
        True, if the value is either int or float.

    - #### isString

          public boolean isString()

      Returns:
        True, if this is a string.

    - #### toBooleanValue

          public boolean toBooleanValue()

      Returns:
        The value as a boolean, or type mismatch if conversion is not possible.

    - #### toFloatValue

          public double toFloatValue()

      Returns:
        The value as a float, or type mismatch if conversion is not possible.

    - #### toIntValue

          public long toIntValue()

      Returns:
        The value as a int, or type mismatch if conversion is not possible.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toStringValue

          public String toStringValue()

      Returns:
        The value as a string, or type mismatch if conversion is not possible.

Copyright © 2014. All Rights Reserved.