|
|
|
@ -32,6 +32,10 @@ public class BoatData {
|
|
|
|
this.boatData = boatData;
|
|
|
|
this.boatData = boatData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Creates an AC35 officially formatted xml description of boats competing in a race
|
|
|
|
|
|
|
|
* @return String containing xml-formatted boats description
|
|
|
|
|
|
|
|
*/
|
|
|
|
public String createXML() {
|
|
|
|
public String createXML() {
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
@ -70,6 +74,10 @@ public class BoatData {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Runs through competing boats, creating an element for each
|
|
|
|
|
|
|
|
* @param boatsElement boats element to be added to
|
|
|
|
|
|
|
|
*/
|
|
|
|
private void appendIndividualBoats(Element boatsElement) {
|
|
|
|
private void appendIndividualBoats(Element boatsElement) {
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i < boatData.size(); i++) {
|
|
|
|
for (int i=0; i < boatData.size(); i++) {
|
|
|
|
@ -87,6 +95,10 @@ public class BoatData {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Creates and appends type attribute of a boat
|
|
|
|
|
|
|
|
* @param boat element being added to
|
|
|
|
|
|
|
|
*/
|
|
|
|
private void appendType(Element boat) {
|
|
|
|
private void appendType(Element boat) {
|
|
|
|
//Type attribute
|
|
|
|
//Type attribute
|
|
|
|
Attr attrType = doc.createAttribute("Type");
|
|
|
|
Attr attrType = doc.createAttribute("Type");
|
|
|
|
@ -94,6 +106,11 @@ public class BoatData {
|
|
|
|
boat.setAttributeNode(attrType);
|
|
|
|
boat.setAttributeNode(attrType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Creates and appends sourceID attribute of a boat
|
|
|
|
|
|
|
|
* @param boat element being added to
|
|
|
|
|
|
|
|
* @param i boat number
|
|
|
|
|
|
|
|
*/
|
|
|
|
private void appendSourceID(Element boat, int i) {
|
|
|
|
private void appendSourceID(Element boat, int i) {
|
|
|
|
//SourceID attribute
|
|
|
|
//SourceID attribute
|
|
|
|
Attr attrSourceID = doc.createAttribute("SourceID");
|
|
|
|
Attr attrSourceID = doc.createAttribute("SourceID");
|
|
|
|
@ -101,6 +118,10 @@ public class BoatData {
|
|
|
|
boat.setAttributeNode(attrSourceID);
|
|
|
|
boat.setAttributeNode(attrSourceID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Creates and appends shapeID attribute of a boat
|
|
|
|
|
|
|
|
* @param boat element being added to
|
|
|
|
|
|
|
|
*/
|
|
|
|
private void appendShapeID(Element boat) {
|
|
|
|
private void appendShapeID(Element boat) {
|
|
|
|
//ShapeID attribute
|
|
|
|
//ShapeID attribute
|
|
|
|
Attr attrShapeID = doc.createAttribute("ShapeID");
|
|
|
|
Attr attrShapeID = doc.createAttribute("ShapeID");
|
|
|
|
@ -108,6 +129,10 @@ public class BoatData {
|
|
|
|
boat.setAttributeNode(attrShapeID);
|
|
|
|
boat.setAttributeNode(attrShapeID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Creates and appends hull name attribute of a boat
|
|
|
|
|
|
|
|
* @param boat element being added to
|
|
|
|
|
|
|
|
*/
|
|
|
|
private void appendHullNum(Element boat) {
|
|
|
|
private void appendHullNum(Element boat) {
|
|
|
|
//HullNum attribute
|
|
|
|
//HullNum attribute
|
|
|
|
Attr attrHullNum = doc.createAttribute("HullNum");
|
|
|
|
Attr attrHullNum = doc.createAttribute("HullNum");
|
|
|
|
@ -115,6 +140,11 @@ public class BoatData {
|
|
|
|
boat.setAttributeNode(attrHullNum);
|
|
|
|
boat.setAttributeNode(attrHullNum);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Creates and appends stow name attribute of a boat
|
|
|
|
|
|
|
|
* @param boat element being added to
|
|
|
|
|
|
|
|
* @param i boat number
|
|
|
|
|
|
|
|
*/
|
|
|
|
private void appendStoweName(Element boat, int i) {
|
|
|
|
private void appendStoweName(Element boat, int i) {
|
|
|
|
//StoweName attribute
|
|
|
|
//StoweName attribute
|
|
|
|
Attr attrStoweName = doc.createAttribute("StoweName");
|
|
|
|
Attr attrStoweName = doc.createAttribute("StoweName");
|
|
|
|
@ -122,6 +152,11 @@ public class BoatData {
|
|
|
|
boat.setAttributeNode(attrStoweName);
|
|
|
|
boat.setAttributeNode(attrStoweName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Creates and appends short name attribute of a boat
|
|
|
|
|
|
|
|
* @param boat element being added to
|
|
|
|
|
|
|
|
* @param i boat number
|
|
|
|
|
|
|
|
*/
|
|
|
|
private void appendShortName(Element boat, int i) {
|
|
|
|
private void appendShortName(Element boat, int i) {
|
|
|
|
//ShortName attribute
|
|
|
|
//ShortName attribute
|
|
|
|
Attr attrShortName = doc.createAttribute("ShortName");
|
|
|
|
Attr attrShortName = doc.createAttribute("ShortName");
|
|
|
|
@ -129,6 +164,11 @@ public class BoatData {
|
|
|
|
boat.setAttributeNode(attrShortName);
|
|
|
|
boat.setAttributeNode(attrShortName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Creates and appends boat name attribute of a boat
|
|
|
|
|
|
|
|
* @param boat element being added to
|
|
|
|
|
|
|
|
* @param i boat number
|
|
|
|
|
|
|
|
*/
|
|
|
|
private void appendBoatName(Element boat, int i) {
|
|
|
|
private void appendBoatName(Element boat, int i) {
|
|
|
|
//BoatName attribute
|
|
|
|
//BoatName attribute
|
|
|
|
Attr attrBoatName = doc.createAttribute("BoatName");
|
|
|
|
Attr attrBoatName = doc.createAttribute("BoatName");
|
|
|
|
@ -136,6 +176,11 @@ public class BoatData {
|
|
|
|
boat.setAttributeNode(attrBoatName);
|
|
|
|
boat.setAttributeNode(attrBoatName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Creates and appends gps attributes of a boat
|
|
|
|
|
|
|
|
* @param boat element being added to
|
|
|
|
|
|
|
|
* @param i boat number
|
|
|
|
|
|
|
|
*/
|
|
|
|
private void appendGPSCoords(Element boat, int i) {
|
|
|
|
private void appendGPSCoords(Element boat, int i) {
|
|
|
|
//GPSCoord for element
|
|
|
|
//GPSCoord for element
|
|
|
|
Element GPSCoord = doc.createElement("GPSposition");
|
|
|
|
Element GPSCoord = doc.createElement("GPSposition");
|
|
|
|
|