org.entur.netex.loader.parser.FareFrameParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of netex-parser-java Show documentation
Show all versions of netex-parser-java Show documentation
Library for parsing NeTEx files and looking up entities in an index.
package org.entur.netex.loader.parser;
import org.entur.netex.index.api.NetexEntitiesIndex;
import org.rutebanken.netex.model.FareFrame_VersionFrameStructure;
import org.rutebanken.netex.model.FareZone;
import java.util.ArrayList;
import java.util.Collection;
public class FareFrameParser extends NetexParser {
private final Collection fareZones = new ArrayList<>();
@Override
void parse(FareFrame_VersionFrameStructure node) {
if (node.getFareZones() != null) {
parseFareZones(node.getFareZones().getFareZone());
}
}
@Override
void setResultOnIndex(NetexEntitiesIndex netexIndex) {
netexIndex.getFareZoneIndex().putAll(fareZones);
}
private void parseFareZones(Collection fareZoneList) {
fareZones.addAll(fareZoneList);
}
}