jess
Class FuncallValue

java.lang.Object
  |
  +--jess.Value
        |
        +--jess.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

(C) 1998 E.J. Friedman-Hill and the Sandia Corporation

Author:
Ernest J. Friedman-Hill
See Also:
Serialized Form

Constructor Summary
FuncallValue(Funcall f)
           
 
Method Summary
 java.lang.String atomValue(Context c)
          Returns the contents of this value, as an atom
 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
 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
 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 variableValue(Context c)
          Returns the contents of this value, as a String (a variable name)
 
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

FuncallValue

public FuncallValue(Funcall f)
             throws JessException
Parameters:
value -  
type -  
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
Following copied from class: jess.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
See Also:
Variable, Funcall

externalAddressValue

public final java.lang.Object externalAddressValue(Context c)
                                            throws JessException
Description copied from class: Value
Returns the contents of this value, as an external adress object
Overrides:
externalAddressValue in class Value
Following copied from class: jess.Value
Returns:
The external address object
Throws:
JessException - If this value does not contain an 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
Following copied from class: jess.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
Following copied from class: jess.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
Following copied from class: jess.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 number
Overrides:
floatValue in class Value
Following copied from class: jess.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
Following copied from class: jess.Value
Returns:
The number as a double
Throws:
JessException - If this value does not contain any kind of number

atomValue

public final java.lang.String atomValue(Context c)
                                 throws JessException
Description copied from class: Value
Returns the contents of this value, as an atom
Overrides:
atomValue in class Value
Following copied from class: jess.Value
Returns:
The atom
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
Following copied from class: jess.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
Following copied from class: jess.Value
Returns:
The string
Throws:
JessException - If this value does not contain any kind of String

© 1997 E.J. Friedman-Hill and Sandia Corporation