com.oziexplorer
Class XY
java.lang.Object
com.oziexplorer.XY
public class XY
- extends Object
This class represents (X, Y) coordinates.
Copyright 2011 Alan Burlison, . All rights reserved.
Use is subject to license terms, see
LICENSE.txt.
Field Summary |
protected int |
x
X value. |
protected int |
y
Y value. |
Constructor Summary |
XY(int x,
int y)
Create a new (X, Y) coordinate. |
Method Summary |
boolean |
equals(Object that)
Test if two coordinates are equal. |
double |
getX()
Get the x value of the coordinate. |
double |
getY()
Get the y value of the coordinate. |
int |
hashCode()
Return the hash code for this object. |
String |
toString()
Return a string representation of the coordinate. |
x
protected final int x
- X value.
y
protected final int y
- Y value.
XY
public XY(int x,
int y)
- Create a new (X, Y) coordinate.
- Parameters:
x
- the x coordinate.y
- the y coordinate.
equals
public boolean equals(Object that)
- Test if two coordinates are equal.
- Overrides:
equals
in class Object
- Parameters:
that
- the object to compare against.
- Returns:
- true if the objects are equal.
hashCode
public int hashCode()
- Return the hash code for this object.
- Overrides:
hashCode
in class Object
- Returns:
- the hash code for this object.
getX
public double getX()
- Get the x value of the coordinate.
- Returns:
- the x value of the coordinate.
getY
public double getY()
- Get the y value of the coordinate.
- Returns:
- the y value of the coordinate.
toString
public String toString()
- Return a string representation of the coordinate.
- Overrides:
toString
in class Object
- Returns:
- a string representation of the coordinate.