|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jess.Value
A class to represent a Jess typed value. Does some 'type conversions'. Subclasses of this are used to represent Variables and other special types.
(C) 1998 E.J. Friedman-Hill and the Sandia Corporation
Constructor Summary | |
Value(boolean b)
Contruct a boolean value object (one of the RU.ATOMs TRUE or FALSE. |
|
Value(double d,
int type)
Contruct a value of floating-point type. |
|
Value(int value,
int type)
Contruct a value of integral type. |
|
Value(java.lang.Object o)
Contruct a value of external address type. |
|
Value(java.lang.String s,
int type)
Contruct a value of String type. |
|
Value(Value v)
Contruct a value that is a copy of another Value. |
|
Value(ValueVector f,
int type)
Contruct a value of list type. |
Method Summary | |
java.lang.String |
atomValue(Context c)
Returns the contents of this value, as an atom |
boolean |
equals(java.lang.Object v)
Compare this value to another object. |
boolean |
equals(Value v)
Compare this value to another value. |
boolean |
equalsStar(Value v)
Like equals(Value) above, but returns true for 3 == 3.0 |
java.lang.Object |
externalAddressValue(Context c)
Returns the contents of this value, as an external adress object |
Fact |
factValue(Context c)
Returns the contents of this value, as a fact |
double |
floatValue(Context c)
Returns the contents of this value, as a number |
Funcall |
funcallValue(Context c)
Returns the contents of this value, as a function call. |
int |
hashCode()
Return a hashcode for the object |
int |
intValue(Context c)
Returns the contents of this value, as an int |
ValueVector |
listValue(Context c)
Returns the contents of this value, as a list |
long |
longValue(Context c)
Returns the contents of this value, as a long |
double |
numericValue(Context c)
Returns the contents of this value, as a number |
Value |
resolveValue(Context c)
Given an evaluation context, return the "true value" of this Value. |
java.lang.String |
stringValue(Context c)
Returns the contents of this value, as a String |
java.lang.String |
toString()
Pretty-print this value, without adding parens to any lists |
java.lang.String |
toStringWithParens()
Pretty-print this value, adding parens to any lists |
int |
type()
Return the type of this variable. |
java.lang.String |
variableValue(Context c)
Returns the contents of this value, as a String (a variable name) |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Value(int value, int type) throws JessException
value
- The valuetype
- The type
JessException
- If the value and type don't match.public Value(Value v)
v
- Value to copypublic Value(java.lang.String s, int type) throws JessException
s
- The valuetype
- The type
JessException
- If the value and type don't match.public Value(ValueVector f, int type) throws JessException
f
- The valuetype
- The type
JessException
- If the value and type don't match.public Value(double d, int type) throws JessException
d
- The valuetype
- The type
JessException
- If the value and type don't match.public Value(boolean b)
b
- The valuepublic Value(java.lang.Object o)
o
- The valueMethod Detail |
public java.lang.Object externalAddressValue(Context c) throws JessException
JessException
- If this value does not contain an objectpublic Funcall funcallValue(Context c) throws JessException
JessException
- If this value does not contain a function callpublic Fact factValue(Context c) throws JessException
JessException
- If this value does not contain a factpublic ValueVector listValue(Context c) throws JessException
JessException
- If this value does not contain a listpublic double numericValue(Context c) throws JessException
JessException
- If this value does not contain any kind of numberpublic int intValue(Context c) throws JessException
JessException
- If this value does not contain any kind of numberpublic long longValue(Context c) throws JessException
JessException
- If this value does not contain any kind of numberpublic double floatValue(Context c) throws JessException
JessException
- If this value does not contain any kind of numberpublic java.lang.String atomValue(Context c) throws JessException
JessException
- If this value does not contain any kind of Stringpublic java.lang.String variableValue(Context c) throws JessException
JessException
- If this value does not contain a variablepublic java.lang.String stringValue(Context c) throws JessException
JessException
- If this value does not contain any kind of Stringpublic java.lang.String toString()
public java.lang.String toStringWithParens()
public int type()
public boolean equals(java.lang.Object v)
v
- The object to compare to.
public boolean equals(Value v)
v
- The Value to compare to.
public boolean equalsStar(Value v)
v
- Value to compare to
public int hashCode()
public Value resolveValue(Context c) throws JessException
c
- An execution context. You can pass null if you are sure
that you're not calling this method on a subclass that uses the
argument.
JessException
Variable
,
Funcall
|
© 2001 E.J. Friedman-Hill and Sandia Corporation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |