private class ScheduleHandler extends DefaultContentHandler {
@Override
public void endElement(Element element) {
if (element instanceof TiplocInsertElement) {
TiplocInsertElement insert = (TiplocInsertElement) element;
if (insert.getStanox() == 0) {
return;
}
_stanoxByTiplocs.put(insert.getTiploc(), insert.getStanox());
Set<String> tiplocs = _tiplocsByStanox.get(insert.getStanox());
if (tiplocs == null) {
tiplocs = new HashSet<String>();
_tiplocsByStanox.put(insert.getStanox(), tiplocs);
}
tiplocs.add(insert.getTiploc());
}
if (element instanceof BasicScheduleElement) {
BasicScheduleElement schedule = (BasicScheduleElement) element;
if (!_schedulesByTrainUid.containsKey(schedule.getTrainUid())) {
_schedulesByTrainUid.put(schedule.getTrainUid(), schedule);