polyglot.frontend
Class AbstractPass

java.lang.Object
  extended by polyglot.frontend.AbstractPass
All Implemented Interfaces:
Pass
Direct Known Subclasses:
Barrier.BarrierPass, ClassFilePass, EmptyPass, MembersAdded.MembersAddedPass, OutputPass, ParserPass, PrettyPrintPass, Scheduler.TheEndGoal.EndPass, SignaturesResolved.SignaturesResolvedPass, SupertypesResolved.SupertypesResolvedPass, VisitorPass

public abstract class AbstractPass
extends java.lang.Object
implements Pass

The base class for most passes.


Field Summary
protected  long exclusive_time
          If the pass is running, the time that the pass started.
protected  Goal goal
           
protected  long inclusive_time
          If the pass is running, the time that the pass started.
 
Constructor Summary
AbstractPass(Goal goal)
           
 
Method Summary
 long exclusiveTime()
          Return the time in ms taken to run the pass, excluding the time in spawned passes
 Goal goal()
          The goal the pass is trying to satisfy.
 long inclusiveTime()
          Return the time in ms taken to run the pass, including the time in spawned passes
 java.lang.String name()
          The human-readable name of the pass.
 void resetTimers()
          Reset the pass timer.
abstract  boolean run()
          Run the pass, returning true on success.
 void toggleTimers(boolean exclusive_only)
          Start or stop the pass timer.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

goal

protected Goal goal

exclusive_time

protected long exclusive_time
If the pass is running, the time that the pass started. If the pass has completed, the time in ms the pass took to run, excluding spawned passes.


inclusive_time

protected long inclusive_time
If the pass is running, the time that the pass started. If the pass has completed, the time in ms the pass took to run, including spawned passes.

Constructor Detail

AbstractPass

public AbstractPass(Goal goal)
Method Detail

goal

public Goal goal()
Description copied from interface: Pass
The goal the pass is trying to satisfy.

Specified by:
goal in interface Pass

name

public java.lang.String name()
The human-readable name of the pass.

Specified by:
name in interface Pass

run

public abstract boolean run()
Run the pass, returning true on success.

Specified by:
run in interface Pass

toggleTimers

public void toggleTimers(boolean exclusive_only)
Start or stop the pass timer.

Specified by:
toggleTimers in interface Pass

resetTimers

public void resetTimers()
Reset the pass timer.

Specified by:
resetTimers in interface Pass

exclusiveTime

public long exclusiveTime()
Return the time in ms taken to run the pass, excluding the time in spawned passes

Specified by:
exclusiveTime in interface Pass

inclusiveTime

public long inclusiveTime()
Return the time in ms taken to run the pass, including the time in spawned passes

Specified by:
inclusiveTime in interface Pass

toString

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