Tidied code, added MidPoint to CompoundMark class

Compound Mark class is now constructed with a list of marks.
A mid point is created on its construction for use in Geo Calculations

#story[1124] #pair[wmu16, hyi25]
This commit is contained in:
William Muir
2017-08-10 13:58:32 +12:00
parent abb15f6edf
commit 9c79897e01
6 changed files with 87 additions and 113 deletions
@@ -79,18 +79,19 @@ public class CourseParser extends FileParser {
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element e = (Element) node;
Integer markID = Integer.valueOf(e.getAttribute("CompoundMarkID"));
String name = e.getAttribute("Name");
CompoundMark cMark = new CompoundMark(markID, name);
NodeList marks = e.getElementsByTagName("Mark");
for (int i = 0; i < marks.getLength(); i++) {
List<Mark> subMarks = new ArrayList<>();
for (int i = 0; i < marks.getLength(); i++) {
Mark mark = getMark(marks.item(i));
if (mark != null)
cMark.addSubMarks(mark);
if (mark != null) {
subMarks.add(mark);
}
}
return cMark;
}
return new CompoundMark(markID, name, subMarks);
}
System.out.println("Failed to create compound mark.");
return null;
}