All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.entur.netex.loader.parser.FareFrameParser Maven / Gradle / Ivy

There is a newer version: 3.1.29
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy