Created Schema for Race xml's and generated classes for reading xml with xjc, made the RaceXMLReader read Corner classes in as well as making a corner class #story[1092]
This commit is contained in:
@@ -51,6 +51,10 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
||||
*/
|
||||
private final List<Leg> legs = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* List of corners in the race
|
||||
*/
|
||||
private final List<Corner> cornersList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* The time that the race.xml file was created.
|
||||
@@ -331,6 +335,10 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
||||
//Gets the ID number of this corner element.
|
||||
int cornerID = getCompoundMarkID(cornerElement);
|
||||
|
||||
int cornerSeq = Integer.parseInt(getAttribute(cornerElement, "SeqID"));
|
||||
|
||||
cornersList.add(new Corner(cornerID, cornerSeq));
|
||||
|
||||
//Gets the CompoundMark associated with this corner.
|
||||
CompoundMark lastCompoundMark = this.compoundMarkMap.get(cornerID);
|
||||
|
||||
@@ -346,6 +354,9 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
||||
//Gets the ID number of this corner element.
|
||||
cornerID = getCompoundMarkID(cornerElement);
|
||||
|
||||
cornerSeq = Integer.parseInt(getAttribute(cornerElement, "SeqID"));
|
||||
|
||||
cornersList.add(new Corner(cornerID, cornerSeq));
|
||||
//Gets the CompoundMark associated with this corner.
|
||||
CompoundMark currentCompoundMark = this.compoundMarkMap.get(cornerID);
|
||||
|
||||
@@ -460,4 +471,8 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
||||
public List<Integer> getParticipants() {
|
||||
return participants;
|
||||
}
|
||||
|
||||
public List<Corner> getCornersList() {
|
||||
return cornersList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package shared.model;
|
||||
|
||||
/**
|
||||
* Created by Gondr on 3/08/2017.
|
||||
*/
|
||||
public class Corner {
|
||||
|
||||
private int id;
|
||||
private int seqID;
|
||||
|
||||
public Corner(int id, int seqID){
|
||||
this.id = id;
|
||||
this.seqID = seqID;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getSeqID() {
|
||||
return seqID;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user