org.niffty
Class FinalPoint

java.lang.Object
  |
  +--org.niffty.FinalPoint

public class FinalPoint
extends java.lang.Object

This is an immutable version of Point where x and y cannot change. This is so that a class can give access to a point and know that other classes will not change it. To convert this to a Point which you can change, call newPoint.

See Also:
newPoint()

Field Summary
 int x
          The x coordinate.
 int y
          The y coordinate.
 
Constructor Summary
FinalPoint(FinalPoint point, int deltaX, int deltaY)
          Creates a new FinalPoint with the coordinates of point added to deltaX and deltaY.
FinalPoint(int x, int y)
          Creates new FinalPoint with the given x and y.
FinalPoint(java.awt.Point point)
          Creates new FinalPoint from the given point.
 
Method Summary
 java.awt.Point newPoint()
          This returns a new Point which you can modify with the same x and y as this.
 java.lang.String toString()
          Return String of the form "(x,y)"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public final int x
The x coordinate.


y

public final int y
The y coordinate.

Constructor Detail

FinalPoint

public FinalPoint(int x,
                  int y)
Creates new FinalPoint with the given x and y.


FinalPoint

public FinalPoint(java.awt.Point point)
Creates new FinalPoint from the given point.


FinalPoint

public FinalPoint(FinalPoint point,
                  int deltaX,
                  int deltaY)
Creates a new FinalPoint with the coordinates of point added to deltaX and deltaY.

Method Detail

newPoint

public java.awt.Point newPoint()
This returns a new Point which you can modify with the same x and y as this.


toString

public java.lang.String toString()
Return String of the form "(x,y)"

Overrides:
toString in class java.lang.Object