DefaultParseResult
Date: 2017-02-11

org.fife.ui.rsyntaxtextarea.parser

## Class DefaultParseResult

- java.lang.Object
- - org.fife.ui.rsyntaxtextarea.parser.DefaultParseResult

- All Implemented Interfaces:
    ParseResult

      public class DefaultParseResult
      extends java.lang.Object
      implements ParseResult

  A basic implementation of `ParseResult`. Most, if not all, `Parser`s can return instances of this class.
  See Also:
    `Parser`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultParseResult(Parser parser)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addNotice(ParserNotice notice)` Adds a parser notice.
    `void` | `clearNotices()` Clears any parser notices in this result.
    `java.lang.Exception` | `getError()` Returns an error that occurred while parsing the document, if any.
    `int` | `getFirstLineParsed()` Returns the first line parsed.
    `int` | `getLastLineParsed()` Returns the first line parsed.
    `java.util.List<ParserNotice>` | `getNotices()` Returns the notices for the parsed section.
    `Parser` | `getParser()` Returns the parser that generated these notices.
    `long` | `getParseTime()` Returns the amount of time this parser took to parse the specified range of text.
    `void` | `setError(java.lang.Exception e)` Sets the error that occurred when last parsing the document, if any.
    `void` | `setParsedLines(int first, int last)` Sets the line range parsed.
    `void` | `setParseTime(long time)` Sets the amount of time it took for this parser to parse the document.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultParseResult

          public DefaultParseResult(Parser parser)

  - ### Method Detail

    - #### addNotice

          public void addNotice(ParserNotice notice)

      Adds a parser notice.
      Parameters:
        `notice` - The new notice.
      See Also:
        `clearNotices()`

    - #### clearNotices

          public void clearNotices()

      Clears any parser notices in this result.
      See Also:
        `addNotice(ParserNotice)`

    - #### getError

          public java.lang.Exception getError()

      Returns an error that occurred while parsing the document, if any.
      Specified by:
        `getError` in interface `ParseResult`
      Returns:
        The error, or `null` if the document was successfully parsed.

    - #### getFirstLineParsed

          public int getFirstLineParsed()

      Returns the first line parsed. All parser implementations should currently set this to `0` and parse the entire document.
      Specified by:
        `getFirstLineParsed` in interface `ParseResult`
      Returns:
        The first line parsed.
      See Also:
        `ParseResult.getLastLineParsed()`

    - #### getLastLineParsed

          public int getLastLineParsed()

      Returns the first line parsed. All parser implementations should currently set this to the document's line count and parse the entire document.
      Specified by:
        `getLastLineParsed` in interface `ParseResult`
      Returns:
        The last line parsed.
      See Also:
        `ParseResult.getFirstLineParsed()`

    - #### getNotices

          public java.util.List<ParserNotice> getNotices()

      Returns the notices for the parsed section.
      Specified by:
        `getNotices` in interface `ParseResult`
      Returns:
        A list of `ParserNotice`s.

    - #### getParseTime

          public long getParseTime()

      Returns the amount of time this parser took to parse the specified range of text. This is an optional operation; parsers are permitted to return `0` for this value.
      Specified by:
        `getParseTime` in interface `ParseResult`
      Returns:
        The parse time, in milliseconds, or `0` if the parse time was not recorded.

    - #### getParser

          public Parser getParser()

      Returns the parser that generated these notices.
      Specified by:
        `getParser` in interface `ParseResult`
      Returns:
        The parser.

    - #### setError

          public void setError(java.lang.Exception e)

      Sets the error that occurred when last parsing the document, if any.
      Parameters:
        `e` - The error that occurred, or `null` if no error occurred.

    - #### setParseTime

          public void setParseTime(long time)

      Sets the amount of time it took for this parser to parse the document.
      Parameters:
        `time` - The amount of time, in milliseconds.
      See Also:
        `getParseTime()`

    - #### setParsedLines

          public void setParsedLines(int first,
                            int last)

      Sets the line range parsed.
      Parameters:
        `first` - The first line parsed, inclusive.
        `last` - The last line parsed, inclusive.
      See Also:
        `getFirstLineParsed()`, `getLastLineParsed()`