1 | public class LineElement implements Element↵ | | 1 | public class RootElement implements Element↵
|
2 | {↵ | | 2 | {↵
|
3 | //{{{ LineElement constructor↵ | | 3 | //{{{ RootElement constructor↵
|
4 | public LineElement(Buffer buffer, int line)↵ | | 4 | public RootElement(Buffer buffer)↵
|
5 | {↵ | | 5 | {↵
|
6 | this.buffer = buffer;↵ | | 6 | this.buffer = buffer;↵
|
7 | this.line = line;↵ | | 7 | ↵
|
8 | } //}}}↵ | | 8 | } //}}}↵
|
|
9 | //{{{ getDocument() method↵ | | 9 | //{{{ getDocument() method↵
|
10 | public Document getDocument()↵ | | 10 | public Document getDocument()↵
|
11 | {↵ | | 11 | {↵
|
12 | return null;↵ | | 12 | return null;↵
|
13 | } //}}}↵ | | 13 | } //}}}↵
|
|
14 | //{{{ getParentElement() method↵ | | 14 | //{{{ getParentElement() method↵
|
15 | public Element getParentElement()↵ | | 15 | public Element getParentElement()↵
|
16 | {↵ | | 16 | {↵
|
17 | return null;↵ | | 17 | return null;↵
|
18 | } //}}}↵ | | 18 | } //}}}↵
|
|
19 | //{{{ getName() method↵ | | 19 | //{{{ getName() method↵
|
20 | public String getName()↵ | | 20 | public String getName()↵
|
21 | {↵ | | 21 | {↵
|
22 | return null;↵ | | 22 | return null;↵
|
23 | } //}}}↵ | | 23 | } //}}}↵
|
|
24 | //{{{ getAttributes() method↵ | | 24 | //{{{ getAttributes() method↵
|
25 | public AttributeSet getAttributes()↵ | | 25 | public AttributeSet getAttributes()↵
|
26 | {↵ | | 26 | {↵
|
27 | return null;↵ | | 27 | return null;↵
|
28 | } //}}}↵ | | 28 | } //}}}↵
|
|
29 | //{{{ getStartOffset() method↵ | | 29 | //{{{ getStartOffset() method↵
|
30 | public int getStartOffset()↵ | | 30 | public int getStartOffset()↵
|
31 | {↵ | | 31 | {↵
|
32 | return buffer.getLineStartOffset(line);↵ | | 32 | return 0;↵
|
33 | } //}}}↵ | | 33 | } //}}}↵
|
|
34 | //{{{ getEndOffset() method↵ | | 34 | //{{{ getEndOffset() method↵
|
35 | public int getEndOffset()↵ | | 35 | public int getEndOffset()↵
|
36 | {↵ | | 36 | {↵
|
37 | return buffer.getLineEndOffset(line);↵ | | 37 | return buffer.getLength() + 1;↵
|
38 | } //}}}↵ | | 38 | } //}}}↵
|
|
39 | //{{{ getElementIndex() method↵ | | 39 | //{{{ getElementIndex() method↵
|
40 | public int getElementIndex(int offset)↵ | | 40 | public int getElementIndex(int offset)↵
|
41 | {↵ | | 41 | {↵
|
42 | return 0;↵ | | 42 | return buffer.getLineOfOffset(offset);↵
|
43 | } //}}}↵ | | 43 | } //}}}↵
|
|
44 | //{{{ getElementCount() method↵ | | 44 | //{{{ getElementCount() method↵
|
45 | public int getElementCount()↵ | | 45 | public int getElementCount()↵
|
46 | {↵ | | 46 | {↵
|
47 | return 0;↵ | | 47 | return buffer.getLineCount();↵
|
48 | } //}}}↵ | | 48 | } //}}}↵
|
|
49 | //{{{ getElement() method↵ | | 49 | //{{{ getElement() method↵
|
50 | public Element getElement(int line)↵ | | 50 | public Element getElement(int line)↵
|
51 | {↵ | | 51 | {↵
|
52 | return null;↵ | | 52 | return new LineElement(buffer,line);↵
|
53 | } //}}}↵ | | 53 | } //}}}↵
|
|
54 | //{{{ isLeaf() method↵ | | 54 | //{{{ isLeaf() method↵
|
55 | public boolean isLeaf()↵ | | 55 | public boolean isLeaf()↵
|
56 | {↵ | | 56 | {↵
|
57 | return true;↵ | | 57 | return false;↵
|
58 | } //}}}↵ | | 58 | } //}}}↵
|
|
59 | //{{{ Private members↵ | | 59 | //{{{ Private members↵
|
60 | private Buffer buffer;↵ | | 60 | private Buffer buffer;↵
|
61 | private int line;↵ | | 61 |
|
62 | | | | |