org.encog.ml.prg.expvalue
Class ExpressionValue
- java.lang.Object
-
- org.encog.ml.prg.expvalue.ExpressionValue
-
- All Implemented Interfaces:
- java.io.Serializable
public class ExpressionValue extends java.lang.Object implements java.io.SerializableAn 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 theEnumType, long theValue)Construct an enum expression.ExpressionValue(long theValue)Construct an integer expression.ExpressionValue(java.lang.String theValue)Construct a string expression.ExpressionValue(ValueType theType)Construct a value of the specified type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetEnumType()ValueTypegetExpressionType()booleanisBoolean()booleanisEnum()booleanisFloat()booleanisInt()booleanisNumeric()booleanisString()booleantoBooleanValue()doubletoFloatValue()longtoIntValue()java.lang.StringtoString()java.lang.StringtoStringValue()
-
-
-
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 theEnumType, long theValue)Construct an enum expression.- Parameters:
theEnumType- The type.theValue- The value to construct.
-
ExpressionValue
public ExpressionValue(long theValue)
Construct an integer expression.- Parameters:
theValue- The value to construct.
-
ExpressionValue
public ExpressionValue(java.lang.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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStringValue
public java.lang.String toStringValue()
- Returns:
- The value as a string, or type mismatch if conversion is not possible.
-
-
DMelt 3.0 © DataMelt by jWork.ORG