|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bluej.extensions.editor.TextLocation
public class TextLocation
A TextLocation object groups two pieces of information: a line number and a column number. They represent a position in the editor's text. A text location represents the gap to the left of the position identified, so that (0, 0) is the start of the file, (0, 1) is between the first and second characters in the file, and so on. There is a TextLocation position to the right of the last character on a line. The column value of this position can be determined using Editor.getLineLength(int line). When applied to a particular edited text, a TextLocation may be invalid. That is, at the time of use, it points to an area outside the text being edited.
Constructor Summary | |
---|---|
TextLocation(int line,
int column)
Create a TextLocation representing the text position at the specified line and column |
Method Summary | |
---|---|
int |
getColumn()
Returns the column of this text location |
int |
getLine()
Returns the line of this text position |
void |
setColumn(int column)
Sets the column of this text position, leaving the line number unchanged. |
void |
setLine(int line)
Sets the line number of this text position, leaving the column unchanged. |
void |
setPosition(int line,
int column)
Set both the line number and column of this text location |
java.lang.String |
toString()
Returns a string representation of this text location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextLocation(int line, int column)
line
- a line number starting from 0column
- a column number starting from 0Method Detail |
---|
public void setLine(int line)
line
- the line number starting from zeropublic int getLine()
public void setColumn(int column)
column
- the column number starting from zeropublic int getColumn()
public void setPosition(int line, int column)
line
- a line number starting from zerocolumn
- a column number starting from zeropublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |