jess
Class Defquery

java.lang.Object
  extended by jess.Node
      extended by jess.HasLHS
          extended by jess.Defquery
All Implemented Interfaces:
java.io.Serializable, Modular, Named, 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) 2013 Sandia Corporation

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
TYPE_ADAPTER, TYPE_NODE1, TYPE_NODE2, TYPE_NODENOT2, TYPE_NONE, TYPE_TERMINAL, TYPE_TEST
 
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, getBindingNames, getConditionalElements, getDisplayName, getDocstring, getGroupSize, getModule, getName, getNext, getNodeCount, getNodeIndexHash, getNodes, getNodeType, getPatternCount, listNodes, setLHS, setNodeIndexHash
 
Methods inherited from class jess.Node
addJessListener, decrementUseCount, getSuccessors, getUseCount, incrementUseCount, removeJessListener, successors
 
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
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()
Overrides:
toString in class java.lang.Object

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
Parameters:
jv - 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

© 2013 Sandia Corporation