com.monad.homerun.rule
Class RuleTrace

java.lang.Object
  extended by com.monad.homerun.rule.RuleTrace
All Implemented Interfaces:
Trace, java.io.Serializable

public class RuleTrace
extends java.lang.Object
implements Trace, java.io.Serializable

RuleTrace is a structure holding detailed rule validation or execution trace data. Implemented as a simple list of trace records

See Also:
Serialized Form

Field Summary
static int ACT_ONLY
           
static int ACT_TYPE
           
static int COND_ACT
           
static int COND_ONLY
           
static int COND_TYPE
           
static int INTERACTIVE_MODE
           
static int RECORD_MODE
           
static int RULE_TYPE
           
 
Constructor Summary
RuleTrace()
           
RuleTrace(boolean validation, int scope)
           
RuleTrace(java.lang.String mode)
           
 
Method Summary
 int addSubTrace(RuleTrace subTrace)
           
 int getClause()
           
 java.lang.String getDesc()
          Returns the text description of the current trace record
 int getMode()
           
 boolean getResult()
          Returns the top-level result of the trace
 int getScope()
           
 int getStatement()
           
 RuleTrace getSubTrace(int index)
           
 int getTerm()
           
 java.lang.String getTermName()
           
 int getType()
           
 boolean hasActionScope()
           
 boolean hasConditionScope()
           
 boolean hasNext()
          Returns whether there are more trace records
 boolean isValidation()
          Is the trace a validation or execution trace?
 void next()
          Advances the record pointer in the trace
 void rewind()
          Prepares the trace for reading
 void setClause(int clause)
           
 void setDesc(java.lang.String desc)
          Sets the current record description
 void setMode(int mode)
           
 void setResult(boolean result)
          Sets the top-level trace result
 void setStatement(int stmt)
           
 void setTerm(int term)
           
 void setTermName(java.lang.String name)
           
 void setType(int type)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COND_ONLY

public static final int COND_ONLY
See Also:
Constant Field Values

ACT_ONLY

public static final int ACT_ONLY
See Also:
Constant Field Values

COND_ACT

public static final int COND_ACT
See Also:
Constant Field Values

COND_TYPE

public static final int COND_TYPE
See Also:
Constant Field Values

ACT_TYPE

public static final int ACT_TYPE
See Also:
Constant Field Values

RULE_TYPE

public static final int RULE_TYPE
See Also:
Constant Field Values

RECORD_MODE

public static final int RECORD_MODE
See Also:
Constant Field Values

INTERACTIVE_MODE

public static final int INTERACTIVE_MODE
See Also:
Constant Field Values
Constructor Detail

RuleTrace

public RuleTrace()

RuleTrace

public RuleTrace(java.lang.String mode)

RuleTrace

public RuleTrace(boolean validation,
                 int scope)
Method Detail

rewind

public void rewind()
Description copied from interface: Trace
Prepares the trace for reading

Specified by:
rewind in interface Trace

hasNext

public boolean hasNext()
Description copied from interface: Trace
Returns whether there are more trace records

Specified by:
hasNext in interface Trace
Returns:
true if more records exist, false otherwise

next

public void next()
Description copied from interface: Trace
Advances the record pointer in the trace

Specified by:
next in interface Trace

isValidation

public boolean isValidation()
Description copied from interface: Trace
Is the trace a validation or execution trace?

Specified by:
isValidation in interface Trace
Returns:
true if a vlaidation trace, false if execution trace

getResult

public boolean getResult()
Description copied from interface: Trace
Returns the top-level result of the trace

Specified by:
getResult in interface Trace
Returns:
true if trace validation or execution successful

getSubTrace

public RuleTrace getSubTrace(int index)

addSubTrace

public int addSubTrace(RuleTrace subTrace)

getScope

public int getScope()

hasConditionScope

public boolean hasConditionScope()

hasActionScope

public boolean hasActionScope()

setResult

public void setResult(boolean result)
Description copied from interface: Trace
Sets the top-level trace result

Specified by:
setResult in interface Trace
Parameters:
result - the trace result

getMode

public int getMode()

setMode

public void setMode(int mode)

getClause

public int getClause()

getStatement

public int getStatement()

getType

public int getType()

getTerm

public int getTerm()

getTermName

public java.lang.String getTermName()

getDesc

public java.lang.String getDesc()
Description copied from interface: Trace
Returns the text description of the current trace record

Specified by:
getDesc in interface Trace
Returns:
desc the current record description

setClause

public void setClause(int clause)

setStatement

public void setStatement(int stmt)

setType

public void setType(int type)

setTerm

public void setTerm(int term)

setTermName

public void setTermName(java.lang.String name)

setDesc

public void setDesc(java.lang.String desc)
Description copied from interface: Trace
Sets the current record description

Specified by:
setDesc in interface Trace
Parameters:
desc - the current description to write


Copyright © 2006-2009 Richard Rodgers. All Rights Reserved.