|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmovement.Path
public class Path
A Path between multiple Coordinates.
| Constructor Summary | |
|---|---|
Path()
Creates a path with zero speed. |
|
Path(double speed)
Creates a path with constant speed |
|
Path(Path path)
Copy constructor. |
|
| Method Summary | |
|---|---|
void |
addWaypoint(Coord wp)
Adds a new waypoint to the end of the path. |
void |
addWaypoint(Coord wp,
double speed)
Adds a new waypoint with a speed towards that waypoint |
java.util.List<Coord> |
getCoords()
Returns a refence to the coordinates of this path |
Coord |
getNextWaypoint()
Returns the next waypoint on this path |
double |
getSpeed()
Returns the speed towards the next waypoint (asked with getNextWaypoint(). |
java.util.List<java.lang.Double> |
getSpeeds()
|
boolean |
hasNext()
Returns true if the path has more waypoints, false if not |
void |
setSpeed(double speed)
Sets a constant speed for the whole path. |
java.lang.String |
toString()
Returns a string presentation of the path's coordinates |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Path()
public Path(Path path)
path - The path to create the copy frompublic Path(double speed)
speed - The speed on the path| Method Detail |
|---|
public void setSpeed(double speed)
public java.util.List<Coord> getCoords()
public void addWaypoint(Coord wp)
wp - The waypoint to add
public void addWaypoint(Coord wp,
double speed)
wp - The waypointspeed - The speed towards that waypointpublic Coord getNextWaypoint()
public boolean hasNext()
public double getSpeed()
getNextWaypoint().
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<java.lang.Double> getSpeeds()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||