jess
Class Funcall

java.lang.Object
  extended byjess.ValueVector
      extended byjess.Funcall
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Funcall
extends ValueVector
implements java.io.Serializable

A class for parsing, assembling, and interpreting function calls.

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

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

Field Summary
static Value EOF
          The object representing end-of-file
static Value FALSE
          The object representing the value FALSE
static Value NIL
          The object representing the value NIL
static Value NILLIST
          An object representing an empty list.
static Value TRUE
          The object representing the value TRUE
 
Constructor Summary
Funcall(java.lang.String name, Rete engine)
          Create a Funcall given the name.
 
Method Summary
 Funcall arg(Value v)
          Calls add(v), then returns this object
 java.lang.Object clone()
          Copies a Funcall
 Funcall cloneInto(Funcall vv)
          Makes the argument into a copy of this Funcall.
 Value execute(Context context)
          Execute this funcall in a particular context.
 java.lang.String toString()
          Formats a Funcall as a String
 java.lang.String toStringWithParens()
          Return a String version of this ValueVector, with parentheses around all ValueVectors.
 
Methods inherited from class jess.ValueVector
add, addAll, cloneInto, copy, equals, get, remove, set, setLength, size
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static Value TRUE
The object representing the value TRUE


FALSE

public static Value FALSE
The object representing the value FALSE


NIL

public static Value NIL
The object representing the value NIL


NILLIST

public static Value NILLIST
An object representing an empty list.


EOF

public static Value EOF
The object representing end-of-file

Constructor Detail

Funcall

public Funcall(java.lang.String name,
               Rete engine)
        throws JessException
Create a Funcall given the name. The Funcall's arguments must then be added using methods inherited from ValueVector.

Parameters:
name - The name of the function
engine - The Rete engine where the function is defined
Throws:
JessException - If something goes wrong.
Method Detail

toString

public java.lang.String toString()
Formats a Funcall as a String

Overrides:
toString in class ValueVector
Returns:
The pretty-print form of this Funcall

toStringWithParens

public java.lang.String toStringWithParens()
Description copied from class: ValueVector
Return a String version of this ValueVector, with parentheses around all ValueVectors.

Overrides:
toStringWithParens in class ValueVector
Returns:
The String

clone

public java.lang.Object clone()
Copies a Funcall

Overrides:
clone in class ValueVector
Returns:
A copy of the Funcall

cloneInto

public Funcall cloneInto(Funcall vv)
Makes the argument into a copy of this Funcall.

Parameters:
vv - The FUncall into which the copy should be made
Returns:
The argument

execute

public final Value execute(Context context)
                    throws JessException
Execute this funcall in a particular context.

Parameters:
context - An execution context for the function
Returns:
The result of the function call
Throws:
JessException - If something goes wrong

arg

public Funcall arg(Value v)
Calls add(v), then returns this object

Parameters:
v - An argument to add to this Funcall
Returns:
This Funcall
See Also:
ValueVector.add(jess.Value)

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