public class WayPoint
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_SPEED
Currently positive infinity.
|
private java.awt.geom.Point2D |
point
The 2-dimensional location of the WayPoint.
|
private double |
speed
The speed at which to transit to the WayPoint.
|
Constructor and Description |
---|
WayPoint(double x,
double y)
Uses DEFAULT_SPEED
|
WayPoint(double x,
double y,
double speed) |
WayPoint(java.awt.geom.Point2D point)
Constructs a new WayPoint with the given location and DEFAULT_SPEED.
|
WayPoint(java.awt.geom.Point2D point,
double speed)
Constructs a new WayPoint with the given location and speed.
|
WayPoint(WayPoint wayPoint)
Copy Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates and returns a shallow copy of this WayPoint.
|
java.awt.geom.Point2D |
getPoint() |
double |
getSpeed() |
java.awt.geom.Point2D |
getWayPoint() |
void |
setSpeed(double speed) |
java.lang.String |
toString()
Returns a String containing the coordinates of this WayPoint and the
speed.
|
public static final double DEFAULT_SPEED
private java.awt.geom.Point2D point
private double speed
public WayPoint(java.awt.geom.Point2D point, double speed)
point
- WayPoint destinationspeed
- speed to this destinationjava.lang.IllegalArgumentException
- If the speed is negative.public WayPoint(java.awt.geom.Point2D point)
point
- WayPoint to be copiedpublic WayPoint(double x, double y, double speed)
x
- X coordinatey
- Y coordinatespeed
- speed to this WayPointpublic WayPoint(double x, double y)
x
- X coordinatey
- Y coordinatepublic WayPoint(WayPoint wayPoint)
wayPoint
- The WayPoint instance to copypublic java.awt.geom.Point2D getPoint()
public java.awt.geom.Point2D getWayPoint()
public void setSpeed(double speed)
speed
- the speed at which to transit to the WayPoint.java.lang.IllegalArgumentException
- If the speed is negative.public double getSpeed()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if clone() not supported