Fixed JavaDoc, spelling errors, and redundant classes

- Removed some default templates (eg: created by X)
- Wrote JavaDoc for classes that had none
- Made JavaDoc more clear for classes
- Linked JavaDoc to other classes
- Minor spelling errors fixed
- BoatInRace and BoatInRaceTest commented out (to be removed)

#story[1003]
This commit is contained in:
Jessica McAuslin
2017-06-28 20:37:01 +12:00
parent 2bbcb10458
commit cf0adb8511
39 changed files with 567 additions and 566 deletions
@@ -1,9 +1,5 @@
package seng302.DataInput;
/**
* Created by hba56 on 10/05/17.
*/
import seng302.Exceptions.InvalidPolarFileException;
import seng302.Model.Bearing;
import seng302.Model.Polars;
@@ -1,9 +1,5 @@
package seng302.Exceptions;
/**
* Created by f123 on 25-Apr-17.
*/
/**
* An exception thrown when we cannot generate Boats.xml and send an XML message.
*/
@@ -1,9 +1,5 @@
package seng302.Exceptions;
/**
* Created by f123 on 10-May-17.
*/
/**
* An exception thrown when we cannot parse a polar data file.
*/
@@ -1,9 +1,5 @@
package seng302.Exceptions;
/**
* Created by f123 on 25-Apr-17.
*/
/**
* Exception thrown when we cannot generate Race.xml data, and send an XML message.
*/
@@ -92,7 +92,7 @@ public class GPSCoordinate {
/**
* Calculates min and max values and passed it to calculate if coordinate is in the boundary
* @param coordinate coordinate of interest
* @param boundary List of points which make a boundry
* @param boundary List of points which make a boundary
* @return true if coordinate is in the boundary
*/
public static boolean isInsideBoundary(GPSCoordinate coordinate, List<GPSCoordinate> boundary) {
@@ -139,7 +139,7 @@ public class GPSCoordinate {
/**
* Helper function to find if a point is in a boundary
* @param boundaryA The first coordinate of the boundary.
* @param boundaryB The second coordinate of the bounary.
* @param boundaryB The second coordinate of the boundary.
* @param coordinate The coordinate to test.
* @return true if a line from the point intersects the two boundary points
*/
@@ -307,7 +307,7 @@ public class GPSCoordinate {
List<Pair<GPSCoordinate, GPSCoordinate>> shrunkEdges = new ArrayList<>();
//We need to invert some of our opertations depending if the boundary is clockwise or anti-clockwise.
//We need to invert some of our operations depending if the boundary is clockwise or anti-clockwise.
boolean isClockwise = GPSCoordinate.isClockwisePolygon(boundary);
double clockwiseScaleFactor = 0;
@@ -318,8 +318,8 @@ public class GPSCoordinate {
}
/**
* Starting at a vertex, face anti-clockwise along an adjacent edge.
/*
Starting at a vertex, face anti-clockwise along an adjacent edge.
Replace the edge with a new, parallel edge placed at distance d to the "left" of the old one.
Repeat for all edges.
Find the intersections of the new edges to get the new vertices.
@@ -337,11 +337,11 @@ public class GPSCoordinate {
Bearing bearing = GPSCoordinate.calculateBearing(firstPoint, secondPoint);
//Calculate angle perpendicular to bearing.
Bearing perpindicularBearing = Bearing.fromDegrees(bearing.degrees() + (90d * clockwiseScaleFactor));
Bearing perpendicularBearing = Bearing.fromDegrees(bearing.degrees() + (90d * clockwiseScaleFactor));
//Translate both first and second point by 50m, using this bearing. These form our inwards shifted edge.
GPSCoordinate firstPointTranslated = GPSCoordinate.calculateNewPosition(firstPoint, shrinkDistance, Azimuth.fromBearing(perpindicularBearing));
GPSCoordinate secondPointTranslated = GPSCoordinate.calculateNewPosition(secondPoint, shrinkDistance, Azimuth.fromBearing(perpindicularBearing));
GPSCoordinate firstPointTranslated = GPSCoordinate.calculateNewPosition(firstPoint, shrinkDistance, Azimuth.fromBearing(perpendicularBearing));
GPSCoordinate secondPointTranslated = GPSCoordinate.calculateNewPosition(secondPoint, shrinkDistance, Azimuth.fromBearing(perpendicularBearing));
//Add edge to list.
shrunkEdges.add(new Pair<>(firstPointTranslated, secondPointTranslated));
@@ -357,11 +357,11 @@ public class GPSCoordinate {
Bearing bearing = GPSCoordinate.calculateBearing(firstPoint, secondPoint);
//Calculate angle perpendicular to bearing.
Bearing perpindicularBearing = Bearing.fromDegrees(bearing.degrees() + (90d * clockwiseScaleFactor));
Bearing perpendicularBearing = Bearing.fromDegrees(bearing.degrees() + (90d * clockwiseScaleFactor));
//Translate both first and second point by 50m, using this bearing. These form our inwards shifted edge.
GPSCoordinate firstPointTranslated = GPSCoordinate.calculateNewPosition(firstPoint, shrinkDistance, Azimuth.fromBearing(perpindicularBearing));
GPSCoordinate secondPointTranslated = GPSCoordinate.calculateNewPosition(secondPoint, shrinkDistance, Azimuth.fromBearing(perpindicularBearing));
GPSCoordinate firstPointTranslated = GPSCoordinate.calculateNewPosition(firstPoint, shrinkDistance, Azimuth.fromBearing(perpendicularBearing));
GPSCoordinate secondPointTranslated = GPSCoordinate.calculateNewPosition(secondPoint, shrinkDistance, Azimuth.fromBearing(perpendicularBearing));
//Add edge to list.
shrunkEdges.add(new Pair<>(firstPointTranslated, secondPointTranslated));
@@ -460,13 +460,13 @@ public class GPSCoordinate {
/**
* Determines if a list of coordinates describes a boundary polygon in clockwise or anti-clockwise order.
* @param boundary The list of coodinates.
* @param boundary The list of coordinates.
* @return True if clockwise, false if anti-clockwise.
*/
public static boolean isClockwisePolygon(List<GPSCoordinate> boundary) {
/** From https://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order
* sum all pairs (x2 − x1)(y2 + y1)
/* From https://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order
sum all pairs (x2 − x1)(y2 + y1)
point[0] = (5,0) edge[0]: (6-5)(4+0) = 4
point[1] = (6,4) edge[1]: (4-6)(5+4) = -18
point[2] = (4,5) edge[2]: (1-4)(5+5) = -30
@@ -4,10 +4,6 @@ import javafx.util.Pair;
import java.util.*;
/**
* Created by hba56 on 10/05/17.
*/
/**
* Encapsulates an entire polar table. Has a function to calculate VMG.
*/
@@ -1,9 +1,5 @@
package seng302.Model;
/**
* Created by f123 on 10-May-17.
*/
/**
* This class encapsulates VMG - that is, velocity made good. It has a speed component and a bearing component.
*/
@@ -13,8 +13,8 @@ import static org.testng.Assert.*;
public class PolarParserTest {
@Test
/**
* Tests if we can parse a polar data file (stored in a string), and create a polar table.
/*
Tests if we can parse a polar data file (stored in a string), and create a polar table.
*/
public void testParse() throws Exception {