for (Iterator<Element> iterator = rootElement.elementIterator(); iterator.hasNext();)
{
Element trackElement = iterator.next();
int trackId = Integer.parseInt(trackElement.attributeValue("id"));
Location startLoc = Location.parse(trackElement);
JumpTrack jumpTrack = new JumpTrack(trackId, startLoc);
for (Iterator<?> wayIterator = trackElement.elementIterator("way"); wayIterator.hasNext();)
{
Element wayElement = (Element) wayIterator.next();
int wayId = Integer.parseInt(wayElement.attributeValue("id"));
JumpWay jumpWay = new JumpWay(wayId);
for (Iterator<?> pointIterator = wayElement.elementIterator("point"); pointIterator.hasNext();)
{
Element pointElement = (Element) pointIterator.next();
Location pointLoc = Location.parse(pointElement);
int nextWayId = Integer.parseInt(pointElement.attributeValue("next_way_id"));
jumpWay.addPoint(new JumpPoint(pointLoc, nextWayId));
}
jumpTrack.addWay(jumpWay);
}
getHolder().addTrack(jumpTrack);
}
}