Package org.nineml.coffeegrinder.util
Class DefaultProgressMonitor
- java.lang.Object
-
- org.nineml.coffeegrinder.util.DefaultProgressMonitor
-
- All Implemented Interfaces:
ProgressMonitor
public class DefaultProgressMonitor extends java.lang.Object implements ProgressMonitor
A default implementation ofProgressMonitor.
-
-
Field Summary
Fields Modifier and Type Field Description static intearleyFrequencyThe default update interval (number of tokens).static intgllFrequencyThe default update interval (number of states).static longminimumTimeInterval
-
Constructor Summary
Constructors Constructor Description DefaultProgressMonitor()Create a progress monitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinished(GearleyParser parser)Finish the monitor.voidprogress(GearleyParser parser, int tokens)Report progress.intstarting(GearleyParser parser, int tokens)Start the monitor.voidworkingSet(GearleyParser parser, int size, int highwater)Report progress.
-
-
-
Method Detail
-
starting
public int starting(GearleyParser parser, int tokens)
Start the monitor.- Specified by:
startingin interfaceProgressMonitor- Parameters:
parser- the parsertokens- the total size of the input- Returns:
- the update interval.
-
progress
public void progress(GearleyParser parser, int tokens)
Report progress.This implementation just prints a simple message to
System.out.- Specified by:
progressin interfaceProgressMonitor- Parameters:
parser- the parsertokens- the number of tokens processed so far.
-
workingSet
public void workingSet(GearleyParser parser, int size, int highwater)
Report progress.This implementation just prints a simple message to
System.out.- Specified by:
workingSetin interfaceProgressMonitor- Parameters:
parser- the parsersize- the number of items that remain in the working set.highwater- the last token seen.
-
finished
public void finished(GearleyParser parser)
Finish the monitor.- Specified by:
finishedin interfaceProgressMonitor- Parameters:
parser- the parser
-
-