jess
Class Defquery

java.lang.Object
  extended byjess.Node
      extended byjess.HasLHS
          extended byjess.Defquery
All Implemented Interfaces:
Modular, Named, jess.NodeSink, java.io.Serializable, Visitable

public class Defquery
extends HasLHS
implements java.io.Serializable

A Defquery is a way of requesting specific information in working memory from procedural code. These are usually constructed by the parser when it sees a "defquery" construct.

(C) 2005 Sandia National Laboratories

See Also:
Serialized Form

Field Summary
static java.lang.String QUERY_TRIGGER
          String prepended to query names to form backwards chaining goals
 
Fields inherited from class jess.Node
LEFT, RIGHT
 
Constructor Summary
Defquery(java.lang.String name, java.lang.String docstring, Rete engine)
           
 
Method Summary
 java.lang.Object accept(Visitor jv)
          A proper accept() implementation should call one of the visitXXX() methods on the Visitor.
 void addCE(jess.ConditionalElementX ce, Rete engine)
          Add a conditional element to this construct
 void addQueryVariable(Variable v)
           
 void callNodeLeft(int tag, Token token, Context context)
          Recieve satisfied queries
 java.lang.String getConstructType()
          Return the type of construct this object is; for example, "defrule", "deftemplate", etc.
 int getMaxBackgroundRules()
          Return the maximum number of rules that will fire during this query.
 int getNVariables()
           
 java.lang.String getQueryTriggerName()
           
 Variable getQueryVariable(int i)
           
 void setMaxBackgroundRules(int maxBackgroundRules)
          Set the maximum number of rules that will fire during this query.
 java.lang.String toString()
           
 
Methods inherited from class jess.HasLHS
addNode, getConditionalElements, getDisplayName, getDocstring, getGroupSize, getModule, getName, getNext, getNodeCount, getNodeIndexHash, getNodes, getPatternCount, listNodes, setLHS, setNodeIndexHash
 
Methods inherited from class jess.Node
addJessListener, getSuccessors, removeJessListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_TRIGGER

public static final java.lang.String QUERY_TRIGGER
String prepended to query names to form backwards chaining goals

See Also:
Constant Field Values
Constructor Detail

Defquery

public Defquery(java.lang.String name,
                java.lang.String docstring,
                Rete engine)
         throws JessException
Method Detail

getMaxBackgroundRules

public int getMaxBackgroundRules()
Return the maximum number of rules that will fire during this query. Queries call Rete.run() when they are executed to allow backward chaining to occur. No more than this number of rules will be allowed to fire.

Returns:
As described

setMaxBackgroundRules

public void setMaxBackgroundRules(int maxBackgroundRules)
Set the maximum number of rules that will fire during this query.

Parameters:
maxBackgroundRules - The new value for this property
See Also:
getMaxBackgroundRules()

callNodeLeft

public void callNodeLeft(int tag,
                         Token token,
                         Context context)
                  throws JessException
Recieve satisfied queries

Throws:
JessException

getQueryTriggerName

public java.lang.String getQueryTriggerName()

addQueryVariable

public void addQueryVariable(Variable v)

getNVariables

public int getNVariables()

getQueryVariable

public Variable getQueryVariable(int i)

addCE

public void addCE(jess.ConditionalElementX ce,
                  Rete engine)
           throws JessException
Description copied from class: HasLHS
Add a conditional element to this construct

Overrides:
addCE in class HasLHS
Throws:
JessException

toString

public java.lang.String toString()

accept

public java.lang.Object accept(Visitor jv)
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
Specified by:
accept in class HasLHS

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

© 2006 Sandia Corporation