com.jidesoft.editor.caret
Class CaretPosition
java.lang.Object
com.jidesoft.editor.caret.CaretPosition
- All Implemented Interfaces:
- Comparable<CaretPosition>
public class CaretPosition
- extends Object
- implements Comparable<CaretPosition>
This class is used to represent a caret position as in CodeEditor.
It has two fields, line and column.
Field Summary |
int |
column
The column of the caret. |
int |
line
This line of the caret. |
line
public final int line
- This line of the caret.
column
public final int column
- The column of the caret.
CaretPosition
public CaretPosition(int line,
int column)
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
paramString
public String paramString()
compareTo
public int compareTo(CaretPosition p)
- Compares this
CaretPosition
to another CaretPosition
.
- Specified by:
compareTo
in interface Comparable<CaretPosition>
- Parameters:
p
- the CaretPosition to compare to.
- Returns:
- the difference between the line of the two positions if the line of the two positions are different. Otherwise,
it will return the column difference.