|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjess.Value
jess.FactIDValue
public class FactIDValue
Use this subclass of Value when you want to create a Value that represents a Fact.
In previous versions of Jess, fact-id's were more like integers; now
they are really references to facts. As such, a fact-id must represent
a valid Fact
object. Call
Value.javaObjectValue(jess.Context)
to get the
Fact object, and call
Fact.getFactId()
to get the fact-id as an integer. This
latter manipulation will now rarely, if ever, be necessary.
Constructor Summary | |
---|---|
FactIDValue(Fact f)
Create a FactIDValue |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object c)
|
boolean |
equals(Value v)
Compare this value to another value. |
Fact |
factValue(Context c)
Returns the contents of this value, as a fact. |
int |
getFactId()
|
int |
hashCode()
Return a hashcode for the object. |
int |
intValue(Context c)
Returns the contents of this value, as an int. |
double |
numericValue(Context c)
Returns the contents of this value, as a number. |
java.lang.String |
toString()
Return a pretty-print version of this value, without adding parens to any lists. |
Methods inherited from class jess.Value |
---|
atomValue, equals, equalsStar, externalAddressValue, floatValue, funcallValue, functionValue, isLexeme, isLiteral, isNumeric, isVariable, javaObjectValue, listValue, longValue, resolveValue, stringValue, symbolValue, toStringWithParens, type, variableValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FactIDValue(Fact f) throws JessException
f
- The fact
JessException
- If the type is invalidMethod Detail |
---|
public int intValue(Context c)
Value
intValue
in class Value
c
- the execution context used to resolve the value
public double numericValue(Context c)
Value
numericValue
in class Value
c
- the execution context used to resolve the value
public Fact factValue(Context c) throws JessException
Value
factValue
in class Value
c
- the execution context used to resolve the value
JessException
- if this value does not contain a factpublic java.lang.String toString()
Value
toString
in class Value
public int hashCode()
Value
hashCode
in class Value
public int getFactId()
public boolean equals(Value v)
Value
equals
in class Value
v
- the Value to compare to.
public int compareTo(java.lang.Object c)
compareTo
in interface java.lang.Comparable
|
© 2013 Sandia Corporation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |