jess
Class Group

java.lang.Object
  extended byjess.Group
All Implemented Interfaces:
java.lang.Cloneable, ConditionalElement, jess.ConditionalElementX, java.io.Serializable, Visitable

public class Group
extends java.lang.Object
implements ConditionalElement, jess.ConditionalElementX, java.io.Serializable, Visitable

A group of patterns on the LHS of a rule, like an "and", "or", "not", "accumulate", or other special CE.

(C) 2006 Sandia National Laboratories

See Also:
Serialized Form

Field Summary
static java.lang.String ACCUMULATE
           
static java.lang.String AND
           
static java.lang.String EXISTS
           
static java.lang.String EXPLICIT
           
static java.lang.String FORALL
           
static java.lang.String LOGICAL
           
static java.lang.String NOT
           
static java.lang.String OR
           
static java.lang.String TEST
           
static java.lang.String UNIQUE
           
 
Constructor Summary
Group(java.lang.String name)
           
 
Method Summary
 java.lang.Object accept(Visitor v)
          A proper accept() implementation should call one of the visitXXX() methods on the Visitor.
 Group add(ConditionalElement g)
           
 Group add(jess.ConditionalElementX newChild)
           
 void addDirectlyMatchedVariables(java.util.Set map)
           
 void addToGroup(Group g)
           
 jess.ConditionalElementX canonicalize()
           
 java.lang.Object clone()
           
 void findVariableDefinitions(int startIndex, java.util.Map bindingsSoFar, java.util.Map newBindings)
          The argument could be a nested group -- a (NOT (AND)).
 boolean getBackwardChaining()
           
 java.lang.String getBoundName()
           
 ConditionalElement getConditionalElement(int i)
           
 jess.ConditionalElementX getConditionalElementX(int i)
           
 int getGroupSize()
           
 boolean getLogical()
           
 java.lang.String getName()
           
 boolean getNegated()
           
 int getPatternCount()
           
 boolean isBackwardChainingTrigger()
           
 boolean isGroup()
           
static boolean isNegatedName(java.lang.String s)
           
 void recordTestedSlots(int oldCount, java.util.Set testedSlots)
           
 void renameUnmentionedVariables(java.util.Set set, java.util.Map subs, int sequenceNumber)
           
 void setBoundName(java.lang.String name)
           
 void setExplicit()
           
 void setLogical()
           
 void setNegated()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AND

public static final java.lang.String AND
See Also:
Constant Field Values

UNIQUE

public static final java.lang.String UNIQUE
See Also:
Constant Field Values

EXPLICIT

public static final java.lang.String EXPLICIT
See Also:
Constant Field Values

NOT

public static final java.lang.String NOT
See Also:
Constant Field Values

EXISTS

public static final java.lang.String EXISTS
See Also:
Constant Field Values

TEST

public static final java.lang.String TEST
See Also:
Constant Field Values

OR

public static final java.lang.String OR
See Also:
Constant Field Values

LOGICAL

public static final java.lang.String LOGICAL
See Also:
Constant Field Values

FORALL

public static final java.lang.String FORALL
See Also:
Constant Field Values

ACCUMULATE

public static final java.lang.String ACCUMULATE
See Also:
Constant Field Values
Constructor Detail

Group

public Group(java.lang.String name)
      throws JessException
Method Detail

clone

public java.lang.Object clone()
Specified by:
clone in interface jess.ConditionalElementX

getName

public java.lang.String getName()
Specified by:
getName in interface ConditionalElement

getPatternCount

public int getPatternCount()
Specified by:
getPatternCount in interface jess.ConditionalElementX

add

public final Group add(ConditionalElement g)
                throws JessException
Throws:
JessException

add

public final Group add(jess.ConditionalElementX newChild)
                throws JessException
Throws:
JessException

getBackwardChaining

public boolean getBackwardChaining()
Specified by:
getBackwardChaining in interface jess.ConditionalElementX

setExplicit

public void setExplicit()
                 throws JessException
Specified by:
setExplicit in interface jess.ConditionalElementX
Throws:
JessException

setLogical

public void setLogical()
                throws JessException
Specified by:
setLogical in interface jess.ConditionalElementX
Throws:
JessException

getLogical

public boolean getLogical()
Specified by:
getLogical in interface jess.ConditionalElementX

getNegated

public boolean getNegated()
Specified by:
getNegated in interface jess.ConditionalElementX

setNegated

public void setNegated()
                throws JessException
Specified by:
setNegated in interface jess.ConditionalElementX
Throws:
JessException

setBoundName

public void setBoundName(java.lang.String name)
                  throws JessException
Specified by:
setBoundName in interface jess.ConditionalElementX
Throws:
JessException

getBoundName

public java.lang.String getBoundName()
Specified by:
getBoundName in interface ConditionalElement

isNegatedName

public static boolean isNegatedName(java.lang.String s)

toString

public java.lang.String toString()

canonicalize

public jess.ConditionalElementX canonicalize()
                                      throws JessException
Specified by:
canonicalize in interface jess.ConditionalElementX
Throws:
JessException

addToGroup

public void addToGroup(Group g)
                throws JessException
Specified by:
addToGroup in interface jess.ConditionalElementX
Throws:
JessException

getGroupSize

public int getGroupSize()
Specified by:
getGroupSize in interface ConditionalElement

isGroup

public boolean isGroup()
Specified by:
isGroup in interface ConditionalElement

getConditionalElement

public ConditionalElement getConditionalElement(int i)
Specified by:
getConditionalElement in interface ConditionalElement

getConditionalElementX

public jess.ConditionalElementX getConditionalElementX(int i)
Specified by:
getConditionalElementX in interface jess.ConditionalElementX

addDirectlyMatchedVariables

public void addDirectlyMatchedVariables(java.util.Set map)
                                 throws JessException
Specified by:
addDirectlyMatchedVariables in interface jess.ConditionalElementX
Throws:
JessException

renameUnmentionedVariables

public void renameUnmentionedVariables(java.util.Set set,
                                       java.util.Map subs,
                                       int sequenceNumber)
                                throws JessException
Specified by:
renameUnmentionedVariables in interface jess.ConditionalElementX
Throws:
JessException

recordTestedSlots

public void recordTestedSlots(int oldCount,
                              java.util.Set testedSlots)
Specified by:
recordTestedSlots in interface jess.ConditionalElementX

isBackwardChainingTrigger

public boolean isBackwardChainingTrigger()
Specified by:
isBackwardChainingTrigger in interface jess.ConditionalElementX

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.

findVariableDefinitions

public void findVariableDefinitions(int startIndex,
                                    java.util.Map bindingsSoFar,
                                    java.util.Map newBindings)
                             throws JessException
The argument could be a nested group -- a (NOT (AND)). In that case, the indexes used for pattern binding should start with the normal CE index and increment from there, but without affecting the "size" of this LHS.These indexes will be used off on a "branch" of the Rete network.

Specified by:
findVariableDefinitions in interface jess.ConditionalElementX
Throws:
JessException

© 2007 Sandia Corporation