edu.ksu.cis.projects.bogor.module.state
Class StateValueVisitor

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.module.state.StateValueVisitor
All Implemented Interfaces:
Disposable

public final class StateValueVisitor
extends Object
implements Disposable

A value visitor for a state.

Version:
CVS $Revision: 1.5 $ $Date: 2005/01/14 15:48:13 $
Author:
Robby , Matt Hoosier

Field Summary
static boolean BREADTH_FIRST
           
static boolean DEPTH_FIRST
           
static boolean FOLLOW_TRANSIENTS
           
static boolean PRUNE_TRANSIENTS
           
static boolean SKIP_RECORD_LOCKS
           
static boolean VISIT_RECORD_LOCKS
           
 
Constructor Summary
StateValueVisitor(SymbolTable symbolTable, IValueVisitorAction valueVisitorAction, boolean depthFirst, boolean visitRecordLock, boolean pruneTransients)
          Default constructor.
 
Method Summary
 void dispose()
          Remove references.
 HashSet<IValue> getSeenSet()
          Gets the seen set of this visitor.
 LinkedList getWorkList()
          Gets the work list of this visitor.
 void setValueComparator(IValueComparator vc)
          Set the value comparator.
 void visit(IState s, IntIntTable threadOrderMap)
          Visits values reachable from a particular state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEPTH_FIRST

public static final boolean DEPTH_FIRST
See Also:
Constant Field Values

BREADTH_FIRST

public static final boolean BREADTH_FIRST
See Also:
Constant Field Values

PRUNE_TRANSIENTS

public static final boolean PRUNE_TRANSIENTS
See Also:
Constant Field Values

FOLLOW_TRANSIENTS

public static final boolean FOLLOW_TRANSIENTS
See Also:
Constant Field Values

VISIT_RECORD_LOCKS

public static final boolean VISIT_RECORD_LOCKS
See Also:
Constant Field Values

SKIP_RECORD_LOCKS

public static final boolean SKIP_RECORD_LOCKS
See Also:
Constant Field Values
Constructor Detail

StateValueVisitor

public StateValueVisitor(SymbolTable symbolTable,
                         IValueVisitorAction valueVisitorAction,
                         boolean depthFirst,
                         boolean visitRecordLock,
                         boolean pruneTransients)
Default constructor.

Parameters:
valueVisitorAction - The value visitor action for this value visitor. Must be non-null.
depthFirst - Indicates whether a DFS (if true) or BFS (otherwise).
visitRecordLock - Indicates whether record locks should be visited.
Method Detail

getSeenSet

public HashSet<IValue> getSeenSet()
Gets the seen set of this visitor.

Returns:
The seen set of this visitor. Non-null.

setValueComparator

public void setValueComparator(IValueComparator vc)
Set the value comparator.

Parameters:
vc - The value comparator.

getWorkList

public LinkedList getWorkList()
Gets the work list of this visitor.

Returns:
The work list of this visitor. Non-null.

dispose

public void dispose()
Description copied from interface: Disposable
Remove references. Once called, avoid using this object.

Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

visit

public void visit(IState s,
                  IntIntTable threadOrderMap)
Visits values reachable from a particular state.

Parameters:
s - The state to start visiting from. Must be non-null.
threadOrderMap - The thread id to its ordering number mapping. The thread will be visited based on the increasing order of in the map. (Only the threads whose id are in the map will be visited). If null, then no ordering is guaranteed and all threads in the state will be visited.