jess
Class Pattern

java.lang.Object
  |
  +--jess.Pattern

public class Pattern
extends java.lang.Object
implements jess.Groupable, java.io.Serializable

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, Rete engine, int negcnt)
           
 
Method Summary
 void addTest(java.lang.String slotname, Test1 aTest)
          Add a test to this pattern
 void addToLHS(HasLHS l)
           
 java.lang.String getBoundName()
           
 Deftemplate getDeftemplate()
           
 boolean getExplicit()
           
 java.lang.String getName()
           
 int getNegated()
          Is this pattern a (not()) CE pattern, possibly nested?
 int getNMultifieldsInSlot(int slot)
           
 int getNSlots()
           
 int getNTests(int slot)
           
 int getSlotLength(int slot)
           
 Test1 getTest(int slot, int test)
           
 boolean getUnique()
           
 boolean isMultifieldSubslot(int slot, int subslot)
           
 void setBoundName(java.lang.String s)
           
 void setExplicit(boolean exp)
           
 void setSlotLength(java.lang.String slotname, int length)
          Set the length of a multislot within a pattern
 void setUnique()
           
 jess.Groupable[] simplify()
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pattern

public Pattern(java.lang.String name,
               Rete engine,
               int negcnt)
        throws JessException
Method Detail

size

public int size()
Returns:
The number of slots in this pattern's Deftemplate

setSlotLength

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

addTest

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

getNegated

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

setUnique

public void setUnique()
Specified by:
setUnique in interface jess.Groupable

getUnique

public boolean getUnique()

setExplicit

public void setExplicit(boolean exp)
Specified by:
setExplicit in interface jess.Groupable

getExplicit

public boolean getExplicit()

getName

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

setBoundName

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

getBoundName

public java.lang.String getBoundName()

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()

addToLHS

public void addToLHS(HasLHS l)
              throws JessException
Specified by:
addToLHS in interface jess.Groupable

simplify

public jess.Groupable[] simplify()
Specified by:
simplify in interface jess.Groupable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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