Interface ProgressMonitor

  • All Known Implementing Classes:
    DefaultProgressMonitor

    public interface ProgressMonitor
    The ProgressMonitor allows you to track the progress of a parse.

    For each parse, the EarleyParser will call starting just before the parse begins, progress periodically during the parse, and finished when the parse is complete.

    • 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 progress method will be called every time that many tokens has been processed. A value of zero (or a negative value) will disable the progress callbacks, but finished will still be called.

        Parameters:
        parser - the parser
        tokens - 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 parser
        tokens - the number of tokens processed so far.
      • workingSet

        void workingSet​(GearleyParser parser,
                        int size,
                        int highwater)
        Indicates progress in the parse.
        Parameters:
        parser - the parser
        size - 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