|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jess.Value jess.Variable
A class to represent a Jess variable. It is 'self-resolving' using Context.
(C) 2006 Sandia National Laboratories
Constructor Summary | |
Variable(java.lang.String name,
int type)
Create a Variable. |
Method Summary | |
Fact |
factValue(Context c)
Resolves the variable, then returns the value as a Fact |
double |
floatValue(Context c)
Resolves the variable, then returns the value as a float |
int |
intValue(Context c)
Resolves the variable, then returns the value as an int |
java.lang.Object |
javaObjectValue(Context c)
Resolves the variable, then returns the value as an Java object. |
ValueVector |
listValue(Context c)
Resolves the variable, then returns the value as a list |
double |
numericValue(Context c)
Resolves the variable, then returns the value as a float |
Value |
resolveValue(Context c)
Will resolve the variable (return the value it represents.) |
java.lang.String |
stringValue(Context c)
Resolves the variable, then returns the value as a string |
java.lang.String |
symbolValue(Context c)
Resolves the variable, then returns the value as a symbol |
java.lang.String |
variableValue(Context c)
Returns the name of this variable |
Methods inherited from class jess.Value |
atomValue, equals, equals, equalsStar, externalAddressValue, funcallValue, functionValue, hashCode, isLexeme, isNumeric, longValue, toString, toStringWithParens, type |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Variable(java.lang.String name, int type) throws JessException
name
- the name of the variabletype
- RU.VARIABLE or RU.MULTIVARIABLE
JessException
- if the type is invalidMethod Detail |
public Value resolveValue(Context c) throws JessException
resolveValue
in class Value
c
- an evaluation context. Cannot be null!
JessException
- if the variable is undefined.Variable
,
Funcall
public final java.lang.Object javaObjectValue(Context c) throws JessException
javaObjectValue
in class Value
c
- the execution context used to resolve the value
JessException
- if this value does not contain a Java objectpublic final Fact factValue(Context c) throws JessException
factValue
in class Value
c
- the execution context used to resolve the value
JessException
- if this value does not contain a factpublic final ValueVector listValue(Context c) throws JessException
listValue
in class Value
c
- the execution context used to resolve the value
JessException
- if this value does not contain a listpublic final int intValue(Context c) throws JessException
intValue
in class Value
c
- the execution context used to resolve the value
JessException
- if this value does not contain any kind of numberpublic final double floatValue(Context c) throws JessException
floatValue
in class Value
c
- the execution context used to resolve the value
JessException
- if this value does not contain any kind of number.public final double numericValue(Context c) throws JessException
numericValue
in class Value
c
- the execution context used to resolve the value
JessException
- if this value does not contain any kind of numberpublic final java.lang.String symbolValue(Context c) throws JessException
symbolValue
in class Value
c
- the execution context used to resolve the value
JessException
- if this value does not contain any kind of Stringpublic final java.lang.String variableValue(Context c)
variableValue
in class Value
c
- the execution context used to resolve the value
public final java.lang.String stringValue(Context c) throws JessException
stringValue
in class Value
c
- the execution context used to resolve the value
JessException
- if this value does not contain any kind of String.
|
© 2007 Sandia Corporation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |