jess
Class Deffacts

java.lang.Object
  |
  +--jess.Deffacts
All Implemented Interfaces:
java.io.Serializable, Visitable

public class Deffacts
extends java.lang.Object
implements java.io.Serializable, Visitable

Class used to represent deffacts. Note that you can create Deffacts objects and add them to a Rete engine using Rete.addDeffacts().

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

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

Constructor Summary
Deffacts(java.lang.String name, java.lang.String docstring, Rete engine)
          Create a deffacts
 
Method Summary
 java.lang.Object accept(Visitor v)
           
 void addFact(Fact fact)
          Add a fact to this deffacts
 java.lang.String getDocstring()
          Fetch the documentation comment, if any, for this deffacts
 Fact getFact(int idx)
          Fetch a single Fact from this deffacts
 java.lang.String getModule()
          Fetch the module of this deffacts
 java.lang.String getName()
          Fetch the name of this deffacts
 int getNFacts()
          Fetch the number of facts in this deffacts
 void reset(Rete engine)
          Assert my facts into engine.
 java.lang.String toString()
          Describe myself
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Deffacts

public Deffacts(java.lang.String name,
                java.lang.String docstring,
                Rete engine)
         throws JessException
Create a deffacts
Parameters:
name - The name of the deffacts
docstring - A documentation string
Method Detail

getName

public final java.lang.String getName()
Fetch the name of this deffacts
Returns:
the name

getModule

public final java.lang.String getModule()
Fetch the module of this deffacts
Returns:
the module

getDocstring

public final java.lang.String getDocstring()
Fetch the documentation comment, if any, for this deffacts
Returns:
the documentation string

addFact

public void addFact(Fact fact)
Add a fact to this deffacts
Parameters:
fact - The fact to add

getNFacts

public int getNFacts()
Fetch the number of facts in this deffacts
Returns:
the number of facts

getFact

public Fact getFact(int idx)
Fetch a single Fact from this deffacts
Parameters:
idx - the o-based index of the desired fact
Returns:
the idx'th fact

reset

public void reset(Rete engine)
           throws JessException
Assert my facts into engine.

toString

public java.lang.String toString()
Describe myself
Overrides:
toString in class java.lang.Object
Returns:
A string representation of this deffacts

accept

public java.lang.Object accept(Visitor v)
Specified by:
accept in interface Visitable

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