|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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(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 |
int |
factIDValue(Context c)
Returns the contents of this value, as a fact-id (an int) |
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[] |
intArrayValue(Context c)
Returns the contents of this value, as an int[] |
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 typepublic Value(Value v)
v
- Value to copypublic Value(java.lang.String s, int type) throws JessException
value
- The valuetype
- The typepublic Value(ValueVector f, int type) throws JessException
value
- The valuetype
- The typepublic Value(double d, int type) throws JessException
value
- The valuetype
- The typepublic Value(java.lang.Object o)
value
- The valueMethod Detail |
public int[] intArrayValue(Context c) throws JessException
public java.lang.Object externalAddressValue(Context c) throws JessException
public Funcall funcallValue(Context c) throws JessException
public Fact factValue(Context c) throws JessException
public ValueVector listValue(Context c) throws JessException
public double numericValue(Context c) throws JessException
public int intValue(Context c) throws JessException
public long longValue(Context c) throws JessException
public double floatValue(Context c) throws JessException
public java.lang.String atomValue(Context c) throws JessException
public java.lang.String variableValue(Context c) throws JessException
public java.lang.String stringValue(Context c) throws JessException
public int factIDValue(Context c) throws JessException
public 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 topublic 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.Variable
,
Funcall
|
© 1997 E.J. Friedman-Hill and Sandia Corporation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |