jess
Class HasLHS

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

public abstract class HasLHS
extends Node
implements java.io.Serializable, Visitable, Modular, jess.NodeSink

Parent class of Defrules and Defqueries.

(C) 2005 Sandia National Laboratories

See Also:
Serialized Form

Field Summary
 
Fields inherited from class jess.Node
LEFT, RIGHT
 
Method Summary
abstract  java.lang.Object accept(Visitor jv)
          A proper accept() implementation should call one of the visitXXX() methods on the Visitor.
protected  void addCE(jess.ConditionalElementX ce, Rete engine)
          Add a conditional element to this construct
 void addNode(Node n)
          Add a node to this sink.
 ConditionalElement getConditionalElements()
          Consider this ConditionalElement to be READ ONLY!
 java.lang.String getDisplayName()
          Fetch the display name of this construct
 java.lang.String getDocstring()
          Get the documentation string for this construct.
 int getGroupSize()
          Fetch the number of elenments on the LHS of this construct.
 java.lang.String getModule()
          Returns the name of the module this construct belongs to.
 java.lang.String getName()
          Fetch the name of this construct
 HasLHS getNext()
          Some rules that use the "or" conditional element can be compiled into multiple subrules.
 int getNodeCount()
           
 int getNodeIndexHash()
          Get the node-index-hash setting of this construct.
 java.util.Iterator getNodes()
           
 int getPatternCount()
           
 java.lang.String listNodes()
          Return a string (useful for debugging) describing all the Rete network nodes connected to this construct.
 void setLHS(Group ce, Rete engine)
           
 void setNodeIndexHash(int h)
          Set the node-index-hash of this construct.
 
Methods inherited from class jess.Node
addJessListener, getSuccessors, removeJessListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jess.Named
getConstructType
 

Method Detail

getGroupSize

public int getGroupSize()
Fetch the number of elenments on the LHS of this construct.

Returns:
The number of CEs

getConditionalElements

public ConditionalElement getConditionalElements()
Consider this ConditionalElement to be READ ONLY!


listNodes

public java.lang.String listNodes()
Return a string (useful for debugging) describing all the Rete network nodes connected to this construct.

Specified by:
listNodes in interface jess.NodeSink
Returns:
A textual description of all the nodes used by this construct

getNext

public HasLHS getNext()
Some rules that use the "or" conditional element can be compiled into multiple subrules. In those situations, those subrules are chained together and can be accessed, in order, using this method.

Returns:
the next subrule or subquery in the chain.

getPatternCount

public int getPatternCount()

setLHS

public void setLHS(Group ce,
                   Rete engine)
            throws JessException
Throws:
JessException

addCE

protected void addCE(jess.ConditionalElementX ce,
                     Rete engine)
              throws JessException
Add a conditional element to this construct

Throws:
JessException

getNodes

public java.util.Iterator getNodes()

getNodeCount

public int getNodeCount()

addNode

public void addNode(Node n)
             throws JessException
Description copied from interface: jess.NodeSink
Add a node to this sink. This addition should be reflected by subsequent calls to "listNodes()".

Specified by:
addNode in interface jess.NodeSink
Parameters:
n - a Rete network node
Throws:
JessException - if n is null

setNodeIndexHash

public void setNodeIndexHash(int h)
Set the node-index-hash of this construct. The node-index-hash value effects the indexing efficiency of the join nodes for this construct. Larger values will make constructs with many partial matches faster (to a point). Must be set before construct is added to engine (so is typically set during parsing via the equivalent Jess command.

Parameters:
h - The node index hash value

getNodeIndexHash

public int getNodeIndexHash()
Get the node-index-hash setting of this construct.

Returns:
The node-index-hash of this construct

getName

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

Specified by:
getName in interface Named
Returns:
The name of this construct

getDisplayName

public java.lang.String getDisplayName()
Fetch the display name of this construct

Returns:
The display name of this construct

getDocstring

public final java.lang.String getDocstring()
Get the documentation string for this construct.

Specified by:
getDocstring in interface Named
Returns:
The docstring for this construct

accept

public abstract 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
Parameters:
jv - a visitor to invoke
Returns:
whatever the invoked Visitor method returns.

getModule

public java.lang.String getModule()
Description copied from interface: Modular
Returns the name of the module this construct belongs to.

Specified by:
getModule in interface Modular
Returns:
a module name

© 2006 Sandia Corporation