jess
Class Test1

java.lang.Object
  extended byjess.Test1
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, TestBase, Visitable

public class Test1
extends java.lang.Object
implements TestBase, java.io.Serializable, Visitable, java.lang.Cloneable

Holds a single test in a Pattern on the LHS of a Rule.

(C) 2006 Sandia National Laboratories

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface jess.TestBase
EQ, NEQ
 
Constructor Summary
Test1(int test, java.lang.String slot, int sub_idx, Value slot_value)
           
Test1(int test, java.lang.String slot, int sub_idx, Value slot_value, int conjunction)
          Create a single test.
Test1(int test, java.lang.String slot, Value slot_value)
           
Test1(int test, java.lang.String slot, Value slot_value, int conjunction)
          Create a single test.
 
Method Summary
 java.lang.Object accept(Visitor jv)
          A proper accept() implementation should call one of the visitXXX() methods on the Visitor.
 java.lang.Object clone()
           
 boolean doTest(Context context)
          Perform the actual test.
 boolean equals(java.lang.Object o)
           
 int getConjunction()
           
 int getMultiSlotIndex()
           
 java.lang.String getSlotName()
           
 int getTest()
           
 Value getValue()
           
 void setMultiSlotIndex(int subIndex)
           
 void setSlotName(java.lang.String slotName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Test1

public Test1(int test,
             java.lang.String slot,
             int sub_idx,
             Value slot_value,
             int conjunction)
Create a single test.

Parameters:
test - TestBase.EQ or TestBase.NEQ
sub_idx - The subfield of a multislot
slot_value - An object test against
conjunction - RU.AND or RU.OR

Test1

public Test1(int test,
             java.lang.String slot,
             Value slot_value,
             int conjunction)
Create a single test.

Parameters:
test - TestBase.EQ or TestBase.NEQ
slot_value - An object test against
conjunction - RU.AND or RU.OR

Test1

public Test1(int test,
             java.lang.String slot,
             int sub_idx,
             Value slot_value)

Test1

public Test1(int test,
             java.lang.String slot,
             Value slot_value)
Method Detail

clone

public java.lang.Object clone()

getTest

public int getTest()

getValue

public Value getValue()

getMultiSlotIndex

public int getMultiSlotIndex()

setMultiSlotIndex

public void setMultiSlotIndex(int subIndex)

getConjunction

public int getConjunction()

doTest

public boolean doTest(Context context)
               throws JessException
Description copied from interface: TestBase
Perform the actual test. The context argument contains all relevant information needed to resolve variables, etc.

Specified by:
doTest in interface TestBase
Parameters:
context - The execution context in which to evaluate the test
Returns:
The result of the test
Throws:
JessException - If anything goes wrong

equals

public boolean equals(java.lang.Object o)

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

toString

public java.lang.String toString()

setSlotName

public void setSlotName(java.lang.String slotName)

getSlotName

public java.lang.String getSlotName()

© 2007 Sandia Corporation