org.openide.text
Class DocumentLine.Set
java.lang.Object
|
+--org.openide.text.Line.Set
|
+--org.openide.text.DocumentLine.Set
- Enclosing class:
- DocumentLine
- public abstract static class DocumentLine.Set
- extends Line.Set
Abstract implementation of Line.Set
.
Defines
ways to obtain a line set for documents following
NetBeans conventions.
Method Summary |
protected abstract Line |
createLine(int offset)
Creates a Line for a given offset. |
Line |
getCurrent(int line)
Find line object representing the line in current document. |
List |
getLines()
Returns a set of line objects sorted by their
line numbers. |
Line |
getOriginal(int line)
Find line object in the line set corresponding to original line number. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocumentLine.Set
public DocumentLine.Set(StyledDocument doc)
- Constructor.
- Parameters:
doc
- document to work on
getLines
public List getLines()
- Description copied from class:
Line.Set
- Returns a set of line objects sorted by their
line numbers. This immutable list will contains all lines held by this
line set.
- Overrides:
getLines
in class Line.Set
- Following copied from class:
org.openide.text.Line.Set
- Returns:
- list of element type
Line
getOriginal
public Line getOriginal(int line)
throws IndexOutOfBoundsException
- Description copied from class:
Line.Set
- Find line object in the line set corresponding to original line number.
That is, finds the line in the current document which originally had the indicated line number.
If there have been modifications of that line, find one as close as possible.
- Overrides:
getOriginal
in class Line.Set
- Following copied from class:
org.openide.text.Line.Set
- Parameters:
line
- number of the line- Returns:
- line object
- Throws:
IndexOutOfBoundsException
- if line
is an invalid index for the original set of lines
getCurrent
public Line getCurrent(int line)
throws IndexOutOfBoundsException
- Description copied from class:
Line.Set
- Find line object representing the line in current document.
- Overrides:
getCurrent
in class Line.Set
- Following copied from class:
org.openide.text.Line.Set
- Parameters:
line
- number of the line in current state of the document- Returns:
- line object
- Throws:
IndexOutOfBoundsException
- if line
is an invalid index for the original set of lines
createLine
protected abstract Line createLine(int offset)
- Creates a
Line
for a given offset.
- Parameters:
offset
- the beginning offset of the line- Returns:
- line object representing the line at this offset
Built on December 12 2001. | Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.