wworld
Class GridPoint

java.lang.Object
  |
  +--wworld.GridPoint
All Implemented Interfaces:
java.lang.Cloneable

public class GridPoint
extends java.lang.Object
implements java.lang.Cloneable

Class specifying object representing each GridPoint in the world.


Constructor Summary
GridPoint()
           
GridPoint(int newx, int newy)
           
 
Method Summary
 void advanceDown()
          Sets the attributes of this gridpoint to point to the location below it.
 void advanceLeft()
          Sets the attributes of this gridpoint to point to the location to its left.
 void advanceRight()
          Sets the attributes of this gridpoint to point to the location to its right.
 void advanceUp()
          Sets the attributes of this gridpoint to point to the location to the location above it.
 java.lang.Object clone()
          Returns an Object that is a copy of this grid point object.
 int getPtX()
          Returns the horizontal position of the location represented by this GridPoint.
 int getPtY()
          Returns the vertical position of the location represented by this GridPoint.
 void setGridPoint(GridPoint p)
          Sets the attributes of this GridPoint to be the same as those of the GridPoint passed to it.
 void setGridPoint(int newx, int newy)
          Sets the attributes to the indicated new values.
 void setPtX(int newx)
          Used to set the x position of this Object.
 void setPtY(int newy)
          Used to set the y position of this object.
 java.lang.String toString()
          Represents this object as a String of the form (x, y).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridPoint

public GridPoint()

GridPoint

public GridPoint(int newx,
                 int newy)
Method Detail

clone

public java.lang.Object clone()
Returns an Object that is a copy of this grid point object.

Overrides:
clone in class java.lang.Object

setPtX

public void setPtX(int newx)
Used to set the x position of this Object.


setPtY

public void setPtY(int newy)
Used to set the y position of this object.


setGridPoint

public void setGridPoint(int newx,
                         int newy)
Sets the attributes to the indicated new values.


setGridPoint

public void setGridPoint(GridPoint p)
Sets the attributes of this GridPoint to be the same as those of the GridPoint passed to it.


getPtX

public int getPtX()
Returns the horizontal position of the location represented by this GridPoint.


getPtY

public int getPtY()
Returns the vertical position of the location represented by this GridPoint.


advanceLeft

public void advanceLeft()
Sets the attributes of this gridpoint to point to the location to its left.


advanceRight

public void advanceRight()
Sets the attributes of this gridpoint to point to the location to its right.


advanceUp

public void advanceUp()
Sets the attributes of this gridpoint to point to the location to the location above it.


advanceDown

public void advanceDown()
Sets the attributes of this gridpoint to point to the location below it.


toString

public java.lang.String toString()
Represents this object as a String of the form (x, y).

Overrides:
toString in class java.lang.Object