NextApp Echo
1.1.4

nextapp.echo
Class Coordinate

java.lang.Object
  extended bynextapp.echo.Coordinate
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class Coordinate
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

An two-dimensional immutable integer (x, y) coordinate.

See Also:
Serialized Form

Field Summary
private  int x
           
private  int y
           
 
Constructor Summary
Coordinate(int x, int y)
          Creates a new coordinate representing the position (x,y) in 2D space.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this coordinate to another.
 boolean equals(java.lang.Object o)
          Returns true if this coordinate is equivalent to the provided object.
 int getX()
          Returns the x position of this coordinate.
 int getY()
          Returns the y position of this coordinate.
 int hashCode()
          Returns a hash code value for this coordinate.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

private int x

y

private int y
Constructor Detail

Coordinate

public Coordinate(int x,
                  int y)
Creates a new coordinate representing the position (x,y) in 2D space.

Parameters:
x - The coordinate x position.
y - The coordinate y position.
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Compares this coordinate to another.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - A Coordinate to compare this coordinate to.
Returns:
A negative integer if this coordinate falls above or to the left of the test object and a positive integer if this coordinate falls below or to the right of it.
See Also:
Comparable.compareTo(Object)

equals

public boolean equals(java.lang.Object o)
Returns true if this coordinate is equivalent to the provided object.

Parameters:
o - The object to test this coordinate for equality with.
Returns:
True if this coordinate is equivalent to the provided object.
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Returns a hash code value for this coordinate.

Returns:
A hash code value for this coordinate.
See Also:
Object.hashCode()

getX

public int getX()
Returns the x position of this coordinate.

Returns:
The x position of this coordinate.

getY

public int getY()
Returns the y position of this coordinate.

Returns:
The y position of this coordinate.

NextApp Echo
1.1.4