jess
Class Deffacts

java.lang.Object
  extended by jess.Deffacts
All Implemented Interfaces:
java.io.Serializable, Named, Visitable

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

A Deffacts is a list of facts that are asserted when the Rete engine is reset.

(C) 2007 Sandia National Laboratories

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)
          A proper accept() implementation should call one of the visitXXX() methods on the Visitor.
 void addFact(Fact fact)
          Add a fact to this deffacts
 java.lang.String getConstructType()
          Return the type of construct this object is; for example, "defrule", "deftemplate", etc.
 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
 java.util.Iterator listFacts()
           
 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
Throws:
JessException
Method Detail

getName

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

Specified by:
getName in interface Named
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

Specified by:
getDocstring in interface Named
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.

Throws:
JessException

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)
Description copied from interface: Visitable
A proper accept() implementation should call one of the visitXXX() methods on the Visitor.

Specified by:
accept in interface Visitable
Parameters:
v - a visitor to invoke
Returns:
whatever the invoked Visitor method returns.

getConstructType

public final java.lang.String getConstructType()
Description copied from interface: Named
Return the type of construct this object is; for example, "defrule", "deftemplate", etc.

Specified by:
getConstructType in interface Named
Returns:
the construct type

listFacts

public java.util.Iterator listFacts()

© 2013 Sandia Corporation