Josh
Native console access wrapper for Java

com.yifanlu.Josh
Class ConsoleCoord

java.lang.Object
  extended by com.yifanlu.Josh.ConsoleCoord

public class ConsoleCoord
extends java.lang.Object

Defines the coordinates of a character cell in a console screen buffer. The origin of the coordinate system (0,0) is at the top, left cell of the buffer.

Since:
0.1
Version:
1.3, 05/29/10
Author:
Yifan Lu
See Also:
Windows' COORD structure

Constructor Summary
ConsoleCoord(int x, int y)
          Creates a point that represents a block in the console window.
 
Method Summary
 boolean equals(java.lang.Object anObject)
          Compares two Objects, if both are ConsoleCoord and have the same X and Y, they are equal.
 int getX()
          Gets the X coordinate.
 int getY()
          Gets the Y coordinate.
 int hashCode()
          Returns a hash code.
 void setX(int x)
          Sets the X coordinate.
 void setY(int y)
          Sets the Y coordinate.
 java.lang.String toString()
          A String representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConsoleCoord

public ConsoleCoord(int x,
                    int y)
Creates a point that represents a block in the console window.

Parameters:
x - The horizontal coordinate or column value.
y - The vertical coordinate or row value.
Method Detail

getX

public int getX()
Gets the X coordinate.

Returns:
The horizontal coordinate or column value.

getY

public int getY()
Gets the Y coordinate.

Returns:
The vertical coordinate or row value.

setX

public void setX(int x)
Sets the X coordinate.

Parameters:
x - The horizontal coordinate or column value.

setY

public void setY(int y)
Sets the Y coordinate.

Parameters:
y - The vertical coordinate or row value.

equals

public boolean equals(java.lang.Object anObject)
Compares two Objects, if both are ConsoleCoord and have the same X and Y, they are equal.

Overrides:
equals in class java.lang.Object
Parameters:
anObject - Another ConsoleCoord object.
Returns:
true if both the X and Y values are equal.

hashCode

public int hashCode()
Returns a hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.

toString

public java.lang.String toString()
A String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The X and Y values as "(X, Y)".

Copyright © 2010 Yifan Lu