RiverRat - An MIT iCampus project | http://web.mit.edu/riverrat/ |
Inheritance diagram for riverrat.RaceObject:
Public Member Functions | |
RaceObject () | |
Default constructor. | |
RaceObject (int newid) | |
Constructor. | |
Vector | getTrack () |
Returns a Vector representing the track of position locations for the target. | |
void | setTrackLength (int length) |
Sets the maximum track length to a specified value. | |
float | getHeading () |
Returns a float with the target's heading in radians. | |
Fix | getFix () |
Returns a Fix with the target's current position. | |
float | getLat () |
Returns a float with the target's current latitude in decimal degrees. | |
float | getLon () |
Returns a float with the target's current longitude in decimal degrees. | |
int | getID () |
Returns the target's id. | |
int | getSN () |
Returns the target's serial number (sn). | |
void | setSN (int newsn) |
Sets the target's serial number (sn). | |
void | update (Fix newfix) |
Updates the target's current position with a Fix. | |
String | objectToString () |
Returns a String with the target's id, Fix (using Fix.fixToString()) and heading in decimal degrees. | |
Package Attributes | |
Fix | thefix |
Vector | track |
int | id |
int | sn |
int | tracklength = 5000 |
Static Package Attributes | |
final boolean | DEBUG = false |
From a physical point of view, these may be boats, marks, finish lines, different types of boats, etc.
A RaceObject has a current position, an id, and a position history.
Definition at line 12 of file RaceObject.java.
|
Default constructor. Creates a RaceObject with id of -1, a Fix with the default constructor, and a track with an empty Vector. Definition at line 26 of file RaceObject.java. |
|
Constructor. Creates a RaceObject with a specific id, a Fix with the default constructor, and a track with an empty Vector.
Definition at line 38 of file RaceObject.java. |
|
Returns a Fix with the target's current position.
Definition at line 77 of file RaceObject.java. |
|
Returns a float with the target's heading in radians.
Definition at line 68 of file RaceObject.java. References riverrat.Fix.getHeading(). |
|
Returns the target's id.
Definition at line 106 of file RaceObject.java. |
|
Returns a float with the target's current latitude in decimal degrees.
Definition at line 87 of file RaceObject.java. References riverrat.Fix.getLat(). |
|
Returns a float with the target's current longitude in decimal degrees.
Definition at line 97 of file RaceObject.java. References riverrat.Fix.getLon(). |
|
Returns the target's serial number (sn).
Definition at line 115 of file RaceObject.java. |
|
Returns a Vector representing the track of position locations for the target.
Definition at line 50 of file RaceObject.java. |
|
Returns a String with the target's id, Fix (using Fix.fixToString()) and heading in decimal degrees.
Definition at line 169 of file RaceObject.java. References riverrat.Fix.fixToString(), and riverrat.Fix.getHeading(). |
|
Sets the target's serial number (sn).
Definition at line 124 of file RaceObject.java. Referenced by riverrat.Race.startElement(). |
|
Sets the maximum track length to a specified value.
Definition at line 59 of file RaceObject.java. |
|
Updates the target's current position with a Fix. Shifts the current position into the top of the track Vector, and updates the target's heading based on the previous position, if the heading has not already been defined in the argument Fix. The track Vector is managed to ensure that it stays the right size.
Reimplemented in riverrat.DynamicMark, and riverrat.StaticMark. Definition at line 138 of file RaceObject.java. References riverrat.Fix.getHeading(), riverrat.Fix.getLat(), riverrat.Fix.getLon(), and riverrat.Fix.setHeading(). Referenced by riverrat.Race.startElement(). |