JIDE 3.5.15

com.jidesoft.editor.caret
Class CaretPosition

java.lang.Object
  extended by 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.
 
Constructor Summary
CaretPosition(int line, int column)
           
 
Method Summary
 int compareTo(CaretPosition p)
          Compares this CaretPosition to another CaretPosition.
 boolean equals(Object o)
           
 int hashCode()
           
 String paramString()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

line

public final int line
This line of the caret.


column

public final int column
The column of the caret.

Constructor Detail

CaretPosition

public CaretPosition(int line,
                     int column)
Method Detail

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.

JIDE 3.5.15