fixed all java doc errors

#story[782]
main
hba56 9 years ago committed by Erika Savell
parent 545ef7aa7f
commit 6888d0bddc

@ -85,6 +85,11 @@ public class MockOutput implements Runnable
/** /**
* Used to give the mocOutput information about boat location to be made into a message and sent * Used to give the mocOutput information about boat location to be made into a message and sent
* @param sourceID id of the boat
* @param lat latitude of boat
* @param lon longitude of boat
* @param heading heading of boat
* @param speed speed of boat
*/ */
public synchronized void parseBoatLocation(int sourceID, double lat, double lon, double heading, double speed){ public synchronized void parseBoatLocation(int sourceID, double lat, double lon, double heading, double speed){

@ -100,28 +100,28 @@ public class BoatLocationMessage extends AC35Data
/** /**
* Ctor, with all parameters. * Ctor, with all parameters.
* *
* @param messageVersionNumber * @param messageVersionNumber message number
* @param time * @param time time of message
* @param sourceID * @param sourceID id of boat
* @param sequenceNumber * @param sequenceNumber number of boat message
* @param deviceType * @param deviceType type of boat
* @param latitude * @param latitude lat of boat
* @param longitude * @param longitude lon of boat
* @param altitude * @param altitude altitude of boat
* @param heading * @param heading heading of boat
* @param pitch * @param pitch pitch of boat
* @param roll * @param roll roll of boat
* @param boatSpeed * @param boatSpeed boats speed
* @param boatCOG * @param boatCOG boat cog
* @param boatSOG * @param boatSOG boat sog
* @param apparentWindSpeed * @param apparentWindSpeed wind speed
* @param apparentWindAngle * @param apparentWindAngle wind angle
* @param trueWindSpeed * @param trueWindSpeed true wind speed
* @param trueWindDirection * @param trueWindDirection true wind direction
* @param trueWindAngle * @param trueWindAngle true wind angle
* @param currentDrift * @param currentDrift current drift
* @param currentSet * @param currentSet current set
* @param rudderAngle * @param rudderAngle rudder angle
*/ */
public BoatLocationMessage(byte messageVersionNumber, long time, int sourceID, long sequenceNumber, byte deviceType, int latitude, int longitude, int altitude, int heading, short pitch, short roll, int boatSpeed, int boatCOG, int boatSOG, int apparentWindSpeed, short apparentWindAngle, int trueWindSpeed, int trueWindDirection, short trueWindAngle, int currentDrift, int currentSet, short rudderAngle) { public BoatLocationMessage(byte messageVersionNumber, long time, int sourceID, long sequenceNumber, byte deviceType, int latitude, int longitude, int altitude, int heading, short pitch, short roll, int boatSpeed, int boatCOG, int boatSOG, int apparentWindSpeed, short apparentWindAngle, int trueWindSpeed, int trueWindDirection, short trueWindAngle, int currentDrift, int currentSet, short rudderAngle) {
super(MessageType.BOATLOCATION); super(MessageType.BOATLOCATION);

@ -25,15 +25,28 @@ public class ByteConverter {
//Integer //Integer
////////////////////////////////////////////////// //////////////////////////////////////////////////
/**
* @param bite bite to convert
* @return int
*/
public static int bytesToInt(byte bite){ public static int bytesToInt(byte bite){
byte[] bytes = {bite}; byte[] bytes = {bite};
return bytesToInt(bytes, ByteOrder.LITTLE_ENDIAN); return bytesToInt(bytes, ByteOrder.LITTLE_ENDIAN);
} }
/**
* @param bytes bytes to convert
* @return int
*/
public static int bytesToInt(byte[] bytes){ public static int bytesToInt(byte[] bytes){
return bytesToInt(bytes, ByteOrder.LITTLE_ENDIAN); return bytesToInt(bytes, ByteOrder.LITTLE_ENDIAN);
} }
/**
* @param bytes bytes to convert
* @param byteOrder order of the bytes
* @return int
*/
public static int bytesToInt(byte[] bytes, ByteOrder byteOrder){ public static int bytesToInt(byte[] bytes, ByteOrder byteOrder){
byte[] bites = convertBytesToNum(bytes,byteOrder, IntegerSize); byte[] bites = convertBytesToNum(bytes,byteOrder, IntegerSize);
return ByteBuffer.wrap(bites).order(byteOrder).getInt(); return ByteBuffer.wrap(bites).order(byteOrder).getInt();
@ -144,7 +157,7 @@ public class ByteConverter {
* @param i the integer to be converted * @param i the integer to be converted
* @param size Size that the byte array should be * @param size Size that the byte array should be
* @param byteOrder the order that the bytes should be ie Big Endian * @param byteOrder the order that the bytes should be ie Big Endian
* @return * @return bytes array
*/ */
public static byte[] intToBytes(int i ,int size, ByteOrder byteOrder){ public static byte[] intToBytes(int i ,int size, ByteOrder byteOrder){
ByteBuffer buffer = ByteBuffer.allocate(IntegerSize); ByteBuffer buffer = ByteBuffer.allocate(IntegerSize);
@ -171,7 +184,7 @@ public class ByteConverter {
* @param i the Long to be converted * @param i the Long to be converted
* @param size Size that the byte array should be * @param size Size that the byte array should be
* @param byteOrder the order that the bytes should be ie Big Endian * @param byteOrder the order that the bytes should be ie Big Endian
* @return * @return byte array
*/ */
public static byte[] longToBytes(long i ,int size, ByteOrder byteOrder){ public static byte[] longToBytes(long i ,int size, ByteOrder byteOrder){
ByteBuffer buffer = ByteBuffer.allocate(LongSize); ByteBuffer buffer = ByteBuffer.allocate(LongSize);
@ -198,7 +211,7 @@ public class ByteConverter {
* @param i the Short to be converted * @param i the Short to be converted
* @param size Size that the byte array should be * @param size Size that the byte array should be
* @param byteOrder the order that the bytes should be ie Big Endian * @param byteOrder the order that the bytes should be ie Big Endian
* @return * @return byte array
*/ */
public static byte[] shortToBytes(short i ,int size, ByteOrder byteOrder){ public static byte[] shortToBytes(short i ,int size, ByteOrder byteOrder){
ByteBuffer buffer = ByteBuffer.allocate(ShortSize); ByteBuffer buffer = ByteBuffer.allocate(ShortSize);
@ -225,7 +238,7 @@ public class ByteConverter {
* @param i the Char to be converted * @param i the Char to be converted
* @param size Size that the byte array should be * @param size Size that the byte array should be
* @param byteOrder the order that the bytes should be ie Big Endian * @param byteOrder the order that the bytes should be ie Big Endian
* @return * @return byte array
*/ */
public static byte[] charToBytes(char i ,int size, ByteOrder byteOrder){ public static byte[] charToBytes(char i ,int size, ByteOrder byteOrder){
ByteBuffer buffer = ByteBuffer.allocate(CharSize); ByteBuffer buffer = ByteBuffer.allocate(CharSize);

@ -117,7 +117,7 @@ public class RaceController extends Controller {
* Initializes and runs the race, based on the user's chosen scale factor * Initializes and runs the race, based on the user's chosen scale factor
* Currently uses an example racecourse * Currently uses an example racecourse
* *
* @param visualiserInput * @param visualiserInput input from network
*/ */
public void startRace(VisualiserInput visualiserInput) { public void startRace(VisualiserInput visualiserInput) {
StreamedRace newRace = new StreamedRace(visualiserInput, this); StreamedRace newRace = new StreamedRace(visualiserInput, this);

@ -100,6 +100,7 @@ public class StartController extends Controller implements Observer {
/** /**
* Countdown timer until race starts. Use PRERACE_TIME to set countdown duration. * Countdown timer until race starts. Use PRERACE_TIME to set countdown duration.
* @param scaleFactor factor to scale by
*/ */
protected void countdownTimer(int scaleFactor) { protected void countdownTimer(int scaleFactor) {
new AnimationTimer() { new AnimationTimer() {

@ -29,6 +29,7 @@ public class BoatXMLReader extends XMLReader {
* @throws IOException error * @throws IOException error
* @throws SAXException error * @throws SAXException error
* @throws ParserConfigurationException error * @throws ParserConfigurationException error
* @throws ParseException error
*/ */
public BoatXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException, ParseException { public BoatXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException, ParseException {
this(filePath, true); this(filePath, true);
@ -41,6 +42,7 @@ public class BoatXMLReader extends XMLReader {
* @throws IOException error * @throws IOException error
* @throws SAXException error * @throws SAXException error
* @throws ParserConfigurationException error * @throws ParserConfigurationException error
* @throws ParseException error
*/ */
public BoatXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException, ParseException { public BoatXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException, ParseException {
super(filePath); super(filePath);
@ -49,6 +51,13 @@ public class BoatXMLReader extends XMLReader {
} }
} }
/**
* Constructor for Boat XML Reader
* @param xmlString sting to read
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public BoatXMLReader(InputStream xmlString) throws IOException, SAXException, ParserConfigurationException { public BoatXMLReader(InputStream xmlString) throws IOException, SAXException, ParserConfigurationException {
super(xmlString); super(xmlString);
read(); read();

@ -46,6 +46,8 @@ public class StreamedCourseXMLReader extends XMLReader {
* @throws IOException error * @throws IOException error
* @throws SAXException error * @throws SAXException error
* @throws ParserConfigurationException error * @throws ParserConfigurationException error
* @throws ParseException error
* @throws StreamedCourseXMLException error
*/ */
public StreamedCourseXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException, ParseException, StreamedCourseXMLException { public StreamedCourseXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException, ParseException, StreamedCourseXMLException {
this(filePath, true); this(filePath, true);
@ -58,6 +60,8 @@ public class StreamedCourseXMLReader extends XMLReader {
* @throws IOException error * @throws IOException error
* @throws SAXException error * @throws SAXException error
* @throws ParserConfigurationException error * @throws ParserConfigurationException error
* @throws ParseException error
* @throws StreamedCourseXMLException error
*/ */
public StreamedCourseXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException, ParseException, StreamedCourseXMLException { public StreamedCourseXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException, ParseException, StreamedCourseXMLException {
super(filePath); super(filePath);
@ -66,17 +70,35 @@ public class StreamedCourseXMLReader extends XMLReader {
} }
} }
/**
* Constructor for Streamed Race XML
* @param xmlString string to read
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
* @throws ParseException error
* @throws StreamedCourseXMLException error
*/
public StreamedCourseXMLReader(InputStream xmlString) throws IOException, SAXException, ParserConfigurationException, ParseException, StreamedCourseXMLException { public StreamedCourseXMLReader(InputStream xmlString) throws IOException, SAXException, ParserConfigurationException, ParseException, StreamedCourseXMLException {
super(xmlString); super(xmlString);
read(); read();
} }
/**
* reads
* @throws ParseException error
* @throws StreamedCourseXMLException error
*/
private void read() throws ParseException, StreamedCourseXMLException { private void read() throws ParseException, StreamedCourseXMLException {
readRace(); readRace();
readParticipants(); readParticipants();
readCourse(); readCourse();
} }
/**
* reads a race
* @throws ParseException error
*/
private void readRace() throws ParseException { private void readRace() throws ParseException {
DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
Element settings = (Element) doc.getElementsByTagName("Race").item(0); Element settings = (Element) doc.getElementsByTagName("Race").item(0);
@ -111,6 +133,10 @@ public class StreamedCourseXMLReader extends XMLReader {
} }
} }
/**
* reads a course
* @throws StreamedCourseXMLException error
*/
private void readCourse() throws StreamedCourseXMLException { private void readCourse() throws StreamedCourseXMLException {
readCompoundMarks(); readCompoundMarks();
readCompoundMarkSequence(); readCompoundMarkSequence();

@ -59,10 +59,10 @@ public abstract class Race implements Runnable {
/** /**
* @deprecated * @deprecated
* @param startingBoats * @param startingBoats boats starting the race
* @param legs * @param legs legs in race
* @param controller * @param controller controller for the race
* @param scaleFactor * @param scaleFactor factor to scale by
*/ */
public Race(Boat[] startingBoats, List<Leg> legs, RaceController controller, int scaleFactor) { public Race(Boat[] startingBoats, List<Leg> legs, RaceController controller, int scaleFactor) {
this(Arrays.asList(startingBoats), legs, controller, scaleFactor); this(Arrays.asList(startingBoats), legs, controller, scaleFactor);

@ -66,7 +66,8 @@ public class RaceClock {
/** /**
* Get ZonedDateTime corresponding to local time zone and given UTC time. * Get ZonedDateTime corresponding to local time zone and given UTC time.
* @param time * @param time time in mills
* @return local date time
*/ */
public ZonedDateTime getLocalTime(long time) { public ZonedDateTime getLocalTime(long time) {
Date utcTime = new Date(time); Date utcTime = new Date(time);

@ -23,6 +23,7 @@ public class RaceConnection {
/** /**
* Tries to create a socket to hostname and port, indicates status after test. * Tries to create a socket to hostname and port, indicates status after test.
* @return true if socket can connect
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public boolean check() { public boolean check() {

@ -134,7 +134,7 @@ public class VisualiserInput implements Runnable
/** /**
* Returns get Mark Rounding Boat Source ID, MarkRound * Returns get Mark Rounding Boat Source ID, MarkRound
* @return * @return the mark rounding
*/ */
public Map<Integer, MarkRounding> getMarkRounding() { public Map<Integer, MarkRounding> getMarkRounding() {
return markRounding; return markRounding;
@ -145,7 +145,7 @@ public class VisualiserInput implements Runnable
* for the whole message then reads that and returns the byte array * for the whole message then reads that and returns the byte array
* @param inStream inputStream from socket * @param inStream inputStream from socket
* @return encoded binary messsage bytes * @return encoded binary messsage bytes
* @throws IOException * @throws IOException made by the inputstream reading
*/ */
private static byte[] getBytes(InputStream inStream) throws IOException { private static byte[] getBytes(InputStream inStream) throws IOException {
while (inStream.available() < 15){ while (inStream.available() < 15){

Loading…
Cancel
Save