jtge.util.grid
Class Coordinate

java.lang.Object
  extended byjtge.util.grid.Coordinate
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

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

Represents a coordinate in a two dimensions space.

FIXME this class is responsible for the cycles in jtge.util.grid

Version:
$Id: Coordinate.java,v 1.8 2005/09/10 14:05:52 mat007 Exp $
Author:
Jean-Laurent Fabre de Morlhon
See Also:
Serialized Form

Field Summary
static Coordinate ORIGIN
          The origin of the coordinate system.
 
Constructor Summary
Coordinate()
          Create a coordinate.
Coordinate(int x, int y)
          Create a coordinate with the supplied x and y.
 
Method Summary
 java.lang.Object clone()
          
 boolean equals(java.lang.Object object)
          
 int getX()
          Getter for the x field.
 int getY()
          Getter for the y field.
 int hashCode()
          
 void setX(int x)
          Setter for the x field.
 void setY(int y)
          Setter for the y field.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ORIGIN

public static final Coordinate ORIGIN
The origin of the coordinate system.

Constructor Detail

Coordinate

public Coordinate()
Create a coordinate.

x and y are initialized with the origin.


Coordinate

public Coordinate(int x,
                  int y)
Create a coordinate with the supplied x and y.

Parameters:
x - the x to set.
y - the y to set.
Method Detail

getX

public int getX()
Getter for the x field.

Returns:
the x of the current coordinate

getY

public int getY()
Getter for the y field.

Returns:
the y of the current coordinate

setX

public void setX(int x)
Setter for the x field.

Parameters:
x - the x to set

setY

public void setY(int y)
Setter for the y field.

Parameters:
y - the y to set

equals

public boolean equals(java.lang.Object object)


hashCode

public int hashCode()


toString

public java.lang.String toString()


clone

public java.lang.Object clone()



Copyright © 2003-2005 . All Rights Reserved.