1 | /*
|
---|
2 | * 07/27/2009
|
---|
3 | *
|
---|
4 | * ParseResult.java - The result of a Parser parsing some section of an
|
---|
5 | * RSyntaxTextArea.
|
---|
6 | *
|
---|
7 | * This library is distributed under a modified BSD license. See the included
|
---|
8 | * RSyntaxTextArea.License.txt file for details.
|
---|
9 | */
|
---|
10 | package org.fife.ui.rsyntaxtextarea.parser;
|
---|
11 |
|
---|
12 | import java.util.List;
|
---|
13 |
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * The result from a {@link Parser}. This contains the section of lines
|
---|
17 | * parsed and any notices for that section.
|
---|
18 | *
|
---|
19 | * @author Robert Futrell
|
---|
20 | * @version 1.0
|
---|
21 | * @see DefaultParseResult
|
---|
22 | * @see ParserNotice
|
---|
23 | */
|
---|
24 | public interface ParseResult {
|
---|
25 |
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * Returns an error that occurred while parsing the document, if any.
|
---|
29 | *
|
---|
30 | * @return The error, or <code>null</code> if the document was
|
---|
31 | * successfully parsed.
|
---|
32 | */
|
---|
33 | public Exception getError();
|
---|
34 |
|
---|
35 |
|
---|
36 | /**
|
---|
37 | * Returns the first line parsed. All parser implementations should
|
---|
38 | * currently set this to <code>0</code> and parse the entire document.
|
---|
39 | *
|
---|
40 | * @return The first line parsed.
|
---|
41 | * @see #getLastLineParsed()
|
---|
42 | */
|
---|
43 | public int getFirstLineParsed();
|
---|
44 |
|
---|
45 |
|
---|
46 | /**
|
---|
47 | * Returns the first line parsed. All parser implementations should
|
---|
48 | * currently set this to the document's line count and parse the entire
|
---|
49 | * document.
|
---|
50 | *
|
---|
51 | * @return The last line parsed.
|
---|
52 | * @see #getFirstLineParsed()
|
---|
53 | */
|
---|
54 | public int getLastLineParsed();
|
---|
55 |
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * Returns the notices for the parsed section.
|
---|
59 | *
|
---|
60 | * @return A list of {@link ParserNotice}s.
|
---|
61 | */
|
---|
62 | public List getNotices();
|
---|
63 |
|
---|
64 |
|
---|
65 | /**
|
---|
66 | * Returns the parser that generated these notices.
|
---|
67 | *
|
---|
68 | * @return The parser.
|
---|
69 | */
|
---|
70 | public Parser getParser();
|
---|
71 |
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * Returns the amount of time this parser took to parse the specified
|
---|
75 | * range of text. This is an optional operation; parsers are permitted
|
---|
76 | * to return <code>0</code> for this value.
|
---|
77 | *
|
---|
78 | * @return The parse time, in milliseconds, or <code>0</code> if the
|
---|
79 | * parse time was not recorded.
|
---|
80 | */
|
---|
81 | public long getParseTime();
|
---|
82 |
|
---|
83 |
|
---|
84 | } |
---|