Mock.PolarParser:

Fixed some javadoc issues
main
fjc40 9 years ago
parent 656212d06d
commit 00c9cb2c83

@ -12,18 +12,16 @@ import java.util.ArrayList;
/** /**
* Responsible for parsing a polar data file, and creating a polar data object. * Responsible for parsing a polar data file, and creating a Polar data object.
*/ */
public class PolarParser { public class PolarParser {
/** /**
* Given a filename, this function parses it and generates a PolarTable object, which can be queried for polar information. * Given a filename, this function parses it and generates a Polar object, which can be queried for polar information.
* @param filename * @param filename The filename to load and read data from (loaded as a resource).
* @return * @return A Polar table containing data from the given file.
*/ */
///TEMP PolarTable = ArrayList<Polar>
public static Polars parse(String filename) throws InvalidPolarFileException { public static Polars parse(String filename) throws InvalidPolarFileException {
//Temporary table to return later. //Temporary table to return later.
Polars polarTable = new Polars(); Polars polarTable = new Polars();
@ -87,8 +85,7 @@ public class PolarParser {
try { try {
//Add the polar value to the polar table //Add the polar value to the polar table
polarTable.addEstimate( Double.parseDouble(row[0]), Double.parseDouble(row[i]), Double.parseDouble(row[i + 1])); polarTable.addEstimate( Double.parseDouble(row[0]), Double.parseDouble(row[i]), Double.parseDouble(row[i + 1]));
} } catch (NumberFormatException e) {
catch (NumberFormatException e) {
throw new InvalidPolarFileException("Could not convert (Row,Col): (" + rowNumber + "," + i +") = " + row[i] + " to a double.", e); throw new InvalidPolarFileException("Could not convert (Row,Col): (" + rowNumber + "," + i +") = " + row[i] + " to a double.", e);
} }
} }

Loading…
Cancel
Save