Class DefaultParseResult
java.lang.Object
org.fife.ui.rsyntaxtextarea.parser.DefaultParseResult
- All Implemented Interfaces:
ParseResult
A basic implementation of
ParseResult. Most, if not all,
Parsers can return instances of this class.- Version:
- 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Exceptionprivate intprivate intprivate List<ParserNotice> private Parserprivate long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNotice(ParserNotice notice) Adds a parser notice.voidClears any parser notices in this result.getError()Returns an error that occurred while parsing the document, if any.intReturns the first line parsed.intReturns the first line parsed.Returns the notices for the parsed section.Returns the parser that generated these notices.longReturns the amount of time this parser took to parse the specified range of text.voidSets the error that occurred when last parsing the document, if any.voidsetParsedLines(int first, int last) Sets the line range parsed.voidsetParseTime(long time) Sets the amount of time it took for this parser to parse the document.
-
Field Details
-
parser
-
firstLineParsed
private int firstLineParsed -
lastLineParsed
private int lastLineParsed -
notices
-
parseTime
private long parseTime -
error
-
-
Constructor Details
-
DefaultParseResult
-
-
Method Details
-
addNotice
Adds a parser notice.- Parameters:
notice- The new notice.- See Also:
-
clearNotices
public void clearNotices()Clears any parser notices in this result.- See Also:
-
getError
Description copied from interface:ParseResultReturns an error that occurred while parsing the document, if any.- Specified by:
getErrorin interfaceParseResult- Returns:
- The error, or
nullif the document was successfully parsed.
-
getFirstLineParsed
public int getFirstLineParsed()Description copied from interface:ParseResultReturns the first line parsed. All parser implementations should currently set this to0and parse the entire document.- Specified by:
getFirstLineParsedin interfaceParseResult- Returns:
- The first line parsed.
- See Also:
-
getLastLineParsed
public int getLastLineParsed()Description copied from interface:ParseResultReturns the first line parsed. All parser implementations should currently set this to the document's line count and parse the entire document.- Specified by:
getLastLineParsedin interfaceParseResult- Returns:
- The last line parsed.
- See Also:
-
getNotices
Description copied from interface:ParseResultReturns the notices for the parsed section.- Specified by:
getNoticesin interfaceParseResult- Returns:
- A list of
ParserNotices.
-
getParser
Description copied from interface:ParseResultReturns the parser that generated these notices.- Specified by:
getParserin interfaceParseResult- Returns:
- The parser.
-
getParseTime
public long getParseTime()Description copied from interface:ParseResultReturns the amount of time this parser took to parse the specified range of text. This is an optional operation; parsers are permitted to return0for this value.- Specified by:
getParseTimein interfaceParseResult- Returns:
- The parse time, in milliseconds, or
0if the parse time was not recorded.
-
setError
Sets the error that occurred when last parsing the document, if any.- Parameters:
e- The error that occurred, ornullif no error occurred.
-
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:
-
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:
-