net.mazewar
Class DirectedPoint

java.lang.Object
  extended by net.mazewar.Point
      extended by net.mazewar.DirectedPoint
All Implemented Interfaces:
java.io.Serializable

public class DirectedPoint
extends Point

An integral representation of a point in two dimensional space, with direction. Sort of like a vector, but zero magnitude.

Version:
$Id: DirectedPoint.java 339 2004-01-23 20:06:22Z geoffw $
Author:
Geoffrey Washburn <geoffw@cis.upenn.edu>
See Also:
Serialized Form

Constructor Summary
DirectedPoint(DirectedPoint dp)
          Create a DirectedPoint from another DirectedPoint.
DirectedPoint(int x, int y, Direction direction)
          Create a DirectedPoint from coordinates and a Direction.
DirectedPoint(Point point, Direction direction)
          Create a DirectedPoint from a Point and a Direction.
 
Method Summary
 Direction getDirection()
          Obtain the Direction of this DirectedPoint.
 Point getPoint()
           
 
Methods inherited from class net.mazewar.Point
getX, getY
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectedPoint

public DirectedPoint(int x,
                     int y,
                     Direction direction)
Create a DirectedPoint from coordinates and a Direction.

Parameters:
x - X-coordinate of this DirectedPoint.
y - Y-coordinate of this DirectedPoint.
direction - The Direction of this DirectedPoint.

DirectedPoint

public DirectedPoint(Point point,
                     Direction direction)
Create a DirectedPoint from a Point and a Direction.

Parameters:
point - Location of this DirectedPoint.
direction - The Direction of this DirectedPoint.

DirectedPoint

public DirectedPoint(DirectedPoint dp)
Create a DirectedPoint from another DirectedPoint.

Parameters:
dp - The DirectedPoint to copy from.
Method Detail

getDirection

public Direction getDirection()
Obtain the Direction of this DirectedPoint.

Returns:
This DirectedPoint's Cardinal Direction.

getPoint

public Point getPoint()