RiverRat - An MIT iCampus project | http://web.mit.edu/riverrat/ |
Inheritance diagram for riverrat.Race:
Public Member Functions | |
Race () | |
Default constructor. | |
Race (String host, int port) | |
Constructor. | |
synchronized int | numBoats () |
Returns the number of Boats in the target Race. | |
synchronized int | numMarks () |
Returns the number of Marks in the target Race. | |
synchronized void | addBoat (Boat newboat) |
Adds a Boat to the Race. | |
synchronized void | addMark (Mark newmark) |
Adds a Mark to the Race. | |
synchronized void | addRaceObject (RaceObject newobject) |
Adds a RaceObject (either a Boat or Mark) to the Race. | |
synchronized Boat | getBoat (int id) throws NoSuchObjectException |
Returns the Boat object with a specific id. | |
synchronized Mark | getMark (int id) throws NoSuchObjectException |
Returns a Mark object with a specific id. | |
synchronized long | getStartTime () |
Returns the start time of the race, in System.time format. | |
synchronized int | getMode () |
Returns the mode that the Race data puller is currently in, which can be either MODE_SETUP, MODE_LIVE, or MODE_NONE. | |
synchronized String | getName () |
Returns the name of the current Regatta or Race. | |
synchronized int | getNum () |
Returns the number of the current Race in the current Regatta. | |
synchronized int | getID () |
Returns the unique ID of the current Race. | |
void | startDocument () throws SAXException |
Part of the ContentHandler interface. | |
void | startElement (String uri, String localpart, String rawname, Attributes attrs) throws SAXException |
Part of the ContentHandler interface. | |
void | endDocument () throws SAXException |
Part of the ContentHandler inteface. | |
void | endElement (String uri, String localpart, String rawname) throws SAXException |
Part of the ContentHandler interface. | |
void | characters (char[] ch, int start, int length) throws SAXException |
Part of the ContentHandler interface, unused. | |
void | endPrefixMapping (String prefix) throws SAXException |
Part of the ContentHandler interface, unused. | |
void | ignorableWhitespace (char[] ch, int start, int length) throws SAXException |
Part of the ContentHandler interface, unused. | |
void | processingInstruction (String target, String data) throws SAXException |
Part of the ContentHandler interface, unused. | |
void | setDocumentLocator (Locator locator) |
Part of the ContentHandler interface, unused. | |
void | skippedEntity (String name) throws SAXException |
Part of the ContentHandler interface, unused. | |
void | startPrefixMapping (String prefix, String uri) throws SAXException |
Part of the ContentHandler interface, unused. | |
Static Public Member Functions | |
void | main (String args[]) |
Test case, spawns RiverRatListener and fills the Race. | |
Static Public Attributes | |
final int | MODE_FINISHED = 3 |
The Race XML handler is not ready to recieve data, and the Race is over. | |
final int | MODE_LIVE = 2 |
The Race XML handler is in the Live mode, and is ready to receive updates from Marks and Boats. | |
final int | MODE_SETUP = 1 |
The Race XML handler is in the Setup mode, and is ready to receive updates about configuration and the states of Marks and Boats. | |
final int | MODE_NONE = 0 |
The Race XML handler is not in any mode, and is not ready to receive any information besides a tag specifying a new mode. | |
Package Attributes | |
RiverRatListener | rrlistener |
Listener used to receive XML stream. | |
Thread | listenthread |
Thread for Listener class. | |
Vector | boatlist |
Vector of boats involved with the Race. | |
Vector | marklist |
Vector of marks involved with the Race. | |
long | starttime |
Starting time of the Race, in System.time format. | |
int | mode |
Mode of the Race XML handler. | |
String | name |
Name of the Regatta the Race is in, or the name of the Race if there is a single Race. | |
int | racenum |
Number of the Race in the given Regatta. | |
int | raceid |
Race ID, a unique identifier. |
Definition at line 15 of file Race.java.
|
Default constructor. Initializes a new Race, sets the starting time to -1. Definition at line 93 of file Race.java. References riverrat.Race.boatlist, riverrat.Race.marklist, and riverrat.Race.starttime. Referenced by riverrat.Race.main(). |
|
Constructor. Takes a host and port as arguments, and passes them to the stream listener to open a connection. Sets the starting time to -1.
Definition at line 107 of file Race.java. References riverrat.Race.listenthread, and riverrat.Race.rrlistener. |
|
Definition at line 137 of file Race.java. References riverrat.Race.boatlist. Referenced by riverrat.Race.addRaceObject(), and riverrat.Race.startElement(). |
|
Definition at line 146 of file Race.java. References riverrat.Race.marklist. Referenced by riverrat.Race.addRaceObject(), and riverrat.Race.startElement(). |
|
Adds a RaceObject (either a Boat or Mark) to the Race.
Definition at line 155 of file Race.java. References riverrat.Race.addBoat(), and riverrat.Race.addMark(). |
|
Part of the ContentHandler inteface. Called when the parser hits the end of an XML document. This should only happen once per race, at the end of the race. |
|
Part of the ContentHandler interface. Called when the parser hits the beginning of an XML element. Definition at line 361 of file Race.java. References riverrat.Race.mode, riverrat.Race.MODE_FINISHED, and riverrat.Race.MODE_NONE. |
|
Returns the Boat object with a specific id.
Definition at line 166 of file Race.java. References riverrat.Race.boatlist. Referenced by riverrat.Race.main(), and riverrat.Race.startElement(). |
|
Returns the unique ID of the current Race.
Definition at line 232 of file Race.java. References riverrat.Race.raceid. |
|
Returns a Mark object with a specific id.
Definition at line 181 of file Race.java. References riverrat.Race.marklist. Referenced by riverrat.Race.startElement(). |
|
Returns the mode that the Race data puller is currently in, which can be either MODE_SETUP, MODE_LIVE, or MODE_NONE.
Definition at line 205 of file Race.java. References riverrat.Race.mode. Referenced by riverrat.Race.main(). |
|
Returns the name of the current Regatta or Race.
Definition at line 214 of file Race.java. References riverrat.Race.name. |
|
Returns the number of the current Race in the current Regatta.
Definition at line 223 of file Race.java. References riverrat.Race.racenum. |
|
Returns the start time of the race, in System.time format.
Definition at line 195 of file Race.java. References riverrat.Race.starttime. |
|
Returns the number of Boats in the target Race.
Definition at line 119 of file Race.java. References riverrat.Race.boatlist. Referenced by riverrat.Race.main(). |
|
Returns the number of Marks in the target Race.
Definition at line 128 of file Race.java. References riverrat.Race.marklist. |
|
Part of the ContentHandler interface. Called when the parser hits the beginning of an XML document. This should only happen once per race, at the beginning of the race. |
|
Part of the ContentHandler interface. Called when the parser hits the beginning of an XML element. Definition at line 249 of file Race.java. References riverrat.Race.addBoat(), riverrat.Race.addMark(), riverrat.Race.getBoat(), riverrat.Race.getMark(), riverrat.Race.mode, riverrat.Race.MODE_LIVE, riverrat.Race.MODE_SETUP, riverrat.Race.name, riverrat.Race.raceid, riverrat.Race.racenum, riverrat.RaceObject.setSN(), riverrat.Race.starttime, and riverrat.RaceObject.update(). |
|
Thread for Listener class. Must run multithreaded so that parsing does not block action from happening in the parent application (e.g. the GUI). If RiverRatListener is a thread instead of this class, implementation in the parent application is easier. Definition at line 56 of file Race.java. Referenced by riverrat.Race.Race(). |
|
Mode of the Race XML handler. This can be Race.MODE_NONE, Race.MODE_LIVE, or Race.MODE_SETUP. Definition at line 71 of file Race.java. Referenced by riverrat.Race.endElement(), riverrat.Race.getMode(), and riverrat.Race.startElement(). |
|
The Race XML handler is not ready to recieve data, and the Race is over. A new Race must be started (created) to recieve data. This is the case after the closing race element. Definition at line 21 of file Race.java. Referenced by riverrat.Race.endElement(), and riverrat.Race.main(). |
|
The Race XML handler is in the Live mode, and is ready to receive updates from Marks and Boats. This is the case when the XML stream is inside a live element. Definition at line 28 of file Race.java. Referenced by riverrat.Race.startElement(). |
|
The Race XML handler is not in any mode, and is not ready to receive any information besides a tag specifying a new mode. This occurs when the XML stream is not inside a setup or live element. Definition at line 42 of file Race.java. Referenced by riverrat.Race.endElement(). |
|
The Race XML handler is in the Setup mode, and is ready to receive updates about configuration and the states of Marks and Boats. This is the case when the XML stream is inside a setup element. Definition at line 35 of file Race.java. Referenced by riverrat.Race.startElement(). |
|
Name of the Regatta the Race is in, or the name of the Race if there is a single Race.
Definition at line 77 of file Race.java. Referenced by riverrat.Race.getName(), and riverrat.Race.startElement(). |
|
Race ID, a unique identifier. Every Race has a unique identifier that refers to it in a Race database. Definition at line 88 of file Race.java. Referenced by riverrat.Race.getID(), and riverrat.Race.startElement(). |
|
Number of the Race in the given Regatta.
Definition at line 82 of file Race.java. Referenced by riverrat.Race.getNum(), and riverrat.Race.startElement(). |
|
Listener used to receive XML stream. Initializes the incoming XML stream and starts parsing using this class for callbacks. Definition at line 48 of file Race.java. Referenced by riverrat.Race.Race(). |