jess
Class FuncallValue

java.lang.Object
  extended byjess.Value
      extended byjess.FuncallValue
All Implemented Interfaces:
java.io.Serializable

public class FuncallValue
extends Value
implements java.io.Serializable

A class to represent a Jess function call stored in a Value. It is 'self-resolving' using Context. Use this subclass of Value when you want to create a Value that represents a function call (for example, when you are creating a jess.Funcall containing nested function calls.)

(C) 2006 Sandia National Laboratories

See Also:
Funcall, Serialized Form

Constructor Summary
FuncallValue(Funcall f)
           
 
Method Summary
 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 double.
 int intValue(Context c)
          Returns the contents of this value, as an int.
 java.lang.Object javaObjectValue(Context c)
          Returns the contents of this value, as a Java object.
 ValueVector listValue(Context c)
          Returns the contents of this value, as a list.
 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 symbolValue(Context c)
          Returns the contents of this value, as a symbol.
 java.lang.String variableValue(Context c)
          Returns the contents of this value, as a String (a variable name).
 
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

FuncallValue

public FuncallValue(Funcall f)
             throws JessException
Method Detail

resolveValue

public Value resolveValue(Context c)
                   throws JessException
Description copied from class: Value
Given an evaluation context, return the "true value" of this Value. For this class, the true value is always "this". For subclasses, the Context may be used to compute a new Value.

Overrides:
resolveValue in class Value
Parameters:
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.
Returns:
this object
Throws:
JessException - if something goes wrong during value resolution
See Also:
Variable, Funcall

javaObjectValue

public final java.lang.Object javaObjectValue(Context c)
                                       throws JessException
Description copied from class: Value
Returns the contents of this value, as a Java object.

Overrides:
javaObjectValue in class Value
Parameters:
c - the execution context used to resolve the value
Returns:
the Java object
Throws:
JessException - if this value does not contain a Java object

factValue

public final Fact factValue(Context c)
                     throws JessException
Description copied from class: Value
Returns the contents of this value, as a fact.

Overrides:
factValue in class Value
Parameters:
c - the execution context used to resolve the value
Returns:
the fact
Throws:
JessException - if this value does not contain a fact

listValue

public final ValueVector listValue(Context c)
                            throws JessException
Description copied from class: Value
Returns the contents of this value, as a list.

Overrides:
listValue in class Value
Parameters:
c - the execution context used to resolve the value
Returns:
the list
Throws:
JessException - if this value does not contain a list

intValue

public final int intValue(Context c)
                   throws JessException
Description copied from class: Value
Returns the contents of this value, as an int.

Overrides:
intValue in class Value
Parameters:
c - the execution context used to resolve the value
Returns:
the number as an int
Throws:
JessException - if this value does not contain any kind of number

floatValue

public final double floatValue(Context c)
                        throws JessException
Description copied from class: Value
Returns the contents of this value, as a double.

Overrides:
floatValue in class Value
Parameters:
c - the execution context used to resolve the value
Returns:
the number as a double
Throws:
JessException - if this value does not contain any kind of number.

numericValue

public final double numericValue(Context c)
                          throws JessException
Description copied from class: Value
Returns the contents of this value, as a number.

Overrides:
numericValue in class Value
Parameters:
c - the execution context used to resolve the value
Returns:
the number as a double
Throws:
JessException - if this value does not contain any kind of number

symbolValue

public final java.lang.String symbolValue(Context c)
                                   throws JessException
Description copied from class: Value
Returns the contents of this value, as a symbol.

Overrides:
symbolValue in class Value
Parameters:
c - the execution context used to resolve the value
Returns:
the symbol
Throws:
JessException - if this value does not contain any kind of String

variableValue

public final java.lang.String variableValue(Context c)
                                     throws JessException
Description copied from class: Value
Returns the contents of this value, as a String (a variable name).

Overrides:
variableValue in class Value
Parameters:
c - the execution context used to resolve the value
Returns:
the name of the variable
Throws:
JessException - if this value does not contain a variable.

stringValue

public final java.lang.String stringValue(Context c)
                                   throws JessException
Description copied from class: Value
Returns the contents of this value, as a String.

Overrides:
stringValue in class Value
Parameters:
c - the execution context used to resolve the value
Returns:
the string
Throws:
JessException - if this value does not contain any kind of String.

© 2007 Sandia Corporation