Package org.nineml.coffeegrinder.parser
Interface ProgressMonitor
-
- All Known Implementing Classes:
DefaultProgressMonitor
public interface ProgressMonitorThe ProgressMonitor allows you to track the progress of a parse.For each parse, the
EarleyParserwill callstartingjust before the parse begins,progressperiodically during the parse, andfinishedwhen the parse is complete.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfinished(GearleyParser parser)Indicates that the parse has finished.voidprogress(GearleyParser parser, int tokens)Indicates progress in the parse.intstarting(GearleyParser parser, int tokens)Indicates that the parse is about to begin.voidworkingSet(GearleyParser parser, int size, int highwater)Indicates progress in the parse.
-
-
-
Method Detail
-
starting
int starting(GearleyParser parser, int tokens)
Indicates that the parse is about to begin.The value returned is a measure of the update frequency. The
progressmethod will be called every time that many tokens has been processed. A value of zero (or a negative value) will disable theprogresscallbacks, butfinishedwill still be called.- Parameters:
parser- the parsertokens- the total size of the input- Returns:
- the update frequency
-
progress
void progress(GearleyParser parser, int tokens)
Indicates progress in the parse.- Parameters:
parser- the parsertokens- the number of tokens processed so far.
-
workingSet
void workingSet(GearleyParser parser, int size, int highwater)
Indicates progress in the parse.- Parameters:
parser- the parsersize- the number of items left to process.highwater- the last token seen.
-
finished
void finished(GearleyParser parser)
Indicates that the parse has finished.- Parameters:
parser- the parser
-
-