|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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) 1998 E.J. Friedman-Hill and the Sandia Corporation
Constructor Summary | |
Variable(java.lang.String name,
int type)
Create a Variable |
Method Summary | |
java.lang.String |
atomValue(Context c)
Resolves the variable, then returns the value as an atom |
java.lang.Object |
externalAddressValue(Context c)
Resolves the variable, then returns the value as an external address. |
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 |
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 |
variableValue(Context c)
Returns the name of this variable |
Methods inherited from class jess.Value |
equals, equals, equalsStar, funcallValue, hashCode, 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 nameof the variabletype
- RU.VARIABLE or RU.MULTIVARIABLEJessException
- 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 undefinedpublic final java.lang.Object externalAddressValue(Context c) throws JessException
externalAddressValue
in class Value
jess.Value
JessException
- If this value does not contain an objectpublic final Fact factValue(Context c) throws JessException
factValue
in class Value
jess.Value
JessException
- If this value does not contain a factpublic final ValueVector listValue(Context c) throws JessException
listValue
in class Value
jess.Value
JessException
- If this value does not contain a listpublic final int intValue(Context c) throws JessException
intValue
in class Value
jess.Value
JessException
- If this value does not contain any kind of numberpublic final double floatValue(Context c) throws JessException
floatValue
in class Value
jess.Value
JessException
- If this value does not contain any kind of numberpublic final double numericValue(Context c) throws JessException
numericValue
in class Value
jess.Value
JessException
- If this value does not contain any kind of numberpublic final java.lang.String atomValue(Context c) throws JessException
atomValue
in class Value
jess.Value
JessException
- If this value does not contain any kind of Stringpublic final java.lang.String variableValue(Context c) throws JessException
variableValue
in class Value
jess.Value
JessException
- If this value does not contain a variablepublic final java.lang.String stringValue(Context c) throws JessException
stringValue
in class Value
jess.Value
JessException
- If this value does not contain any kind of String
|
© 1997 E.J. Friedman-Hill and Sandia Corporation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |