lib.datatypes
Class AbsoluteCoordinate

java.lang.Object
  |
  +--lib.datatypes.AbsoluteCoordinate

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

AbsoluteCoordinate represents a point in positive cartesian space (x >= 0, y >= 0).

Copyright (c) 2002 Alex Carreira

Version:
1.0
Author:
Alex Carreira

Constructor Summary
AbsoluteCoordinate(int aX, int aY)
          Create an instance of Absolute Coordinate.
 
Method Summary
 void add(AbsoluteCoordinate aAC)
           
 void addDimension(AbsoluteDimension aAD)
           
 java.lang.Object clone()
           
 int getX()
           
 int getY()
           
 void setCoordinate(int aX, int aY)
          Change the X and Y coordinates of the AbsoluteCoordinate instance.
 void setX(int aX)
          Change the X value of an instance of AbsoluteCoordinate.
 void setY(int aY)
          Change the Y value of an instance of AbsoluteCoordinate.
 void subDimension(AbsoluteDimension aAD)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbsoluteCoordinate

public AbsoluteCoordinate(int aX,
                          int aY)
                   throws AbsoluteCoordinateException
Create an instance of Absolute Coordinate.
Parameters:
aX - The X coordinate of the new AbsoluteCoordinate instance.
aY - The Y coordinate of the new AbsoluteCoordinate instance.
Throws:
AbsoluteCoordinateException - if the coordinates are less than zero.
Method Detail

setX

public void setX(int aX)
          throws AbsoluteCoordinateException
Change the X value of an instance of AbsoluteCoordinate.
Parameters:
aX - The X coordinate of the new AbsoluteCoordinate instance.
Throws:
AbsoluteCoordinateException - if aX is less than zero.

getX

public int getX()
Returns:
An integer representing the X coordinate of the AbsoluteCoordinate instance.

setY

public void setY(int aY)
          throws AbsoluteCoordinateException
Change the Y value of an instance of AbsoluteCoordinate.
Parameters:
aY - The Y coordinate of the new AbsoluteCoordinate instance.
Throws:
AbsoluteCoordinateException - if aY is less than zero.

getY

public int getY()
Returns:
An integer representing the Y coordinate of the AbsoluteCoordinate instance.

setCoordinate

public void setCoordinate(int aX,
                          int aY)
                   throws AbsoluteCoordinateException
Change the X and Y coordinates of the AbsoluteCoordinate instance.
Parameters:
aX - The X coordinate of the new AbsoluteCoordinate instance.
aY - The Y coordinate of the new AbsoluteCoordinate instance.
Throws:
AbsoluteCoordinateException - if the coordinates are less than zero.

add

public void add(AbsoluteCoordinate aAC)
Parameters:
aAC - An AbsoluteCoordinate to add to this AbsoluteCoordinate Instance.

addDimension

public void addDimension(AbsoluteDimension aAD)
Parameters:
aAD - An AbsoluteDimension to add to this AbsoluteCoordinate Instance.

subDimension

public void subDimension(AbsoluteDimension aAD)
                  throws AbsoluteCoordinateException
Parameters:
aAD - An AbsoluteCoordinate to subtract from this AbsoluteCoordinate Instance.
Throws:
AbsoluteCoordinateException - if the subtraction results in a negative X or Y value for this AbsoluteCoordinate.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()