com.wrq.vhi.script.api
Class CursorPosition

java.lang.Object
  extended by com.wrq.vhi.script.api.CursorPosition

public class CursorPosition
extends java.lang.Object

An immutable class that represents a cursor position on a screen.


Constructor Summary
CursorPosition(int offset, int screenHeight, int screenWidth)
          Constructs a CursorPosition object from an offset and screen height and width.
 
Method Summary
 boolean equals(java.lang.Object object)
          Compares one cursor position to another.
 int getColumn()
          Gets the one-based cursor column.
 int getOffset()
          Gets the zero-based linear offset of the cursor.
 int getRow()
          Gets the one-based cursor row.
 int getScreenHeight()
          Gets the screen height in rows.
 int getScreenWidth()
          Gets the screen width in columns.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CursorPosition

public CursorPosition(int offset,
                      int screenHeight,
                      int screenWidth)
Constructs a CursorPosition object from an offset and screen height and width.

Parameters:
offset - linear offset
screenHeight - screen height
screenWidth - screen width
Method Detail

getOffset

public int getOffset()
Gets the zero-based linear offset of the cursor.

Returns:
linear offset

getRow

public int getRow()
Gets the one-based cursor row.

Returns:
the cursor row

getColumn

public int getColumn()
Gets the one-based cursor column.

Returns:
the cursor column

getScreenHeight

public int getScreenHeight()
Gets the screen height in rows.

Returns:
the screen height

getScreenWidth

public int getScreenWidth()
Gets the screen width in columns.

Returns:
the screen width

equals

public boolean equals(java.lang.Object object)
Compares one cursor position to another. A cursor position is considered equal if the linear offset, screen height and screen width are all equal.

Overrides:
equals in class java.lang.Object
Parameters:
object -
Returns:
true if the cursor position is the same, otherwise false

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object