org.cfpm.caves.za
Class Dump

java.lang.Object
  extended by org.cfpm.caves.za.Dump
All Implemented Interfaces:
jess.Userfunction

public class Dump
extends java.lang.Object
implements jess.Userfunction

This class implements a user function in Jess. The parameterless function "dump" calls the method of the same name on the model class. To be used on the RHS of rules. This allows (a) to toggle output on/off via one model parameter, given that all Jess output uses the dump function, and (b) an efficient way to call a method on the model without having to put the model fact in the LHS of a rule.

Author:
Ruth

Field Summary
(package private)  SouthAfricaModel model
          a reference to the model
 
Constructor Summary
Dump(SouthAfricaModel model)
          Creates the user function with the given model
 
Method Summary
 jess.Value call(jess.ValueVector vv, jess.Context context)
          calls the function with the given parameter and context from Jess.
 java.lang.String getName()
          returns the name of the function in Jess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

SouthAfricaModel model
a reference to the model

Constructor Detail

Dump

public Dump(SouthAfricaModel model)
Creates the user function with the given model

Parameters:
model - the model
Method Detail

getName

public java.lang.String getName()
returns the name of the function in Jess

Specified by:
getName in interface jess.Userfunction

call

public jess.Value call(jess.ValueVector vv,
                       jess.Context context)
                throws jess.JessException
calls the function with the given parameter and context from Jess.

Specified by:
call in interface jess.Userfunction
Parameters:
vv - the list of parameters (ignored)
context - the Jess context (ignored)
Returns:
NIL
Throws:
jess.JessException