jess
Class Pattern

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

public class Pattern
extends java.lang.Object
implements ConditionalElement, jess.LHSComponent, java.io.Serializable, Visitable

Pattern represents a single conditional element on a rule LHS. A Pattern consists mainly of a two-dimensional array of Test1 structures. Each Test1 contains information about a specific characteristic of a slot.

(C) 1997 Ernest J. Friedman-Hill and Sandia National Laboratories

Author:
Ernest J. Friedman-Hill
See Also:
Serialized Form

Constructor Summary
Pattern(java.lang.String name, Deftemplate deft)
           
Pattern(java.lang.String name, Rete engine)
           
 
Method Summary
 java.lang.Object accept(Visitor jv)
           
 void addDirectlyMatchedVariables(java.util.Map map)
           
 void addTest(java.lang.String slotname, Test1 aTest)
          Add a test to this pattern
 void addToGroup(jess.Group g)
           
 jess.LHSComponent canonicalize()
           
 java.lang.Object clone()
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getBackchainingTemplateName()
           
 boolean getBackwardChaining()
           
 java.lang.String getBoundName()
           
 ConditionalElement getConditionalElement(int i)
           
 Deftemplate getDeftemplate()
           
 boolean getExplicit()
           
 int getGroupSize()
           
 jess.LHSComponent getLHSComponent(int i)
           
 boolean getLogical()
           
 java.lang.String getName()
           
 java.lang.String getNameWithoutBackchainingPrefix()
           
 boolean getNegated()
          Is this pattern a (not()) CE pattern, possibly nested?
 int getNMultifieldsInSlot(int slot)
           
 int getNSlots()
           
 int getNTests(int slot)
           
 int getPatternCount()
           
 int getSlotLength(int slot)
           
 Test1 getTest(int slot, int test)
           
 boolean isBackwardChainingTrigger()
           
 boolean isGroup()
           
 boolean isMultifieldSubslot(int slot, int subslot)
           
 void renameUnmentionedVariables(java.util.Map map, java.util.Map substitutes, int size, HasLHS unused)
           
 void setBoundName(java.lang.String s)
           
 void setExplicit()
           
 void setLogical()
           
 void setNegated()
           
 void setSlotLength(java.lang.String slotname, int length)
          Set the length of a multislot within a pattern
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pattern

public Pattern(java.lang.String name,
               Rete engine)
        throws JessException

Pattern

public Pattern(java.lang.String name,
               Deftemplate deft)
Method Detail

clone

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

setSlotLength

public void setSlotLength(java.lang.String slotname,
                          int length)
                   throws JessException
Set the length of a multislot within a pattern

Throws:
JessException

addTest

public void addTest(java.lang.String slotname,
                    Test1 aTest)
             throws JessException
Add a test to this pattern

Throws:
JessException

addDirectlyMatchedVariables

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

renameUnmentionedVariables

public void renameUnmentionedVariables(java.util.Map map,
                                       java.util.Map substitutes,
                                       int size,
                                       HasLHS unused)
                                throws JessException
Specified by:
renameUnmentionedVariables in interface jess.LHSComponent
Throws:
JessException

getNegated

public boolean getNegated()
Is this pattern a (not()) CE pattern, possibly nested?

Specified by:
getNegated in interface jess.LHSComponent

setNegated

public void setNegated()
Specified by:
setNegated in interface jess.LHSComponent

setLogical

public void setLogical()
Specified by:
setLogical in interface jess.LHSComponent

getLogical

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

setExplicit

public void setExplicit()
Specified by:
setExplicit in interface jess.LHSComponent

getExplicit

public boolean getExplicit()

getBackwardChaining

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

getName

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

setBoundName

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

getBoundName

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

getNSlots

public int getNSlots()

getNTests

public int getNTests(int slot)

getSlotLength

public int getSlotLength(int slot)

getNMultifieldsInSlot

public int getNMultifieldsInSlot(int slot)

isMultifieldSubslot

public boolean isMultifieldSubslot(int slot,
                                   int subslot)

getTest

public Test1 getTest(int slot,
                     int test)

getDeftemplate

public Deftemplate getDeftemplate()

addToGroup

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

canonicalize

public jess.LHSComponent canonicalize()
Specified by:
canonicalize in interface jess.LHSComponent

accept

public java.lang.Object accept(Visitor jv)
Specified by:
accept in interface Visitable

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

getPatternCount

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

getLHSComponent

public jess.LHSComponent getLHSComponent(int i)
Specified by:
getLHSComponent in interface jess.LHSComponent

equals

public boolean equals(java.lang.Object o)

isBackwardChainingTrigger

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

getBackchainingTemplateName

public java.lang.String getBackchainingTemplateName()

getNameWithoutBackchainingPrefix

public java.lang.String getNameWithoutBackchainingPrefix()

toString

public java.lang.String toString()

© 2001 E.J. Friedman-Hill and Sandia Corporation