Class PlanitServiceNetworkWriter

    • Constructor Detail

      • PlanitServiceNetworkWriter

        protected PlanitServiceNetworkWriter​(org.goplanit.xml.generated.XMLElementServiceNetwork xmlRawServiceNetwork)
        Constructor
        Parameters:
        xmlRawServiceNetwork - to populate with PLANit network when persisting
      • PlanitServiceNetworkWriter

        protected PlanitServiceNetworkWriter​(String networkPath,
                                             org.goplanit.xml.generated.XMLElementServiceNetwork xmlRawServiceNetwork)
        Constructor
        Parameters:
        networkPath - to persist network on
        xmlRawServiceNetwork - to populate with PLANit service network when persisting
      • PlanitServiceNetworkWriter

        protected PlanitServiceNetworkWriter​(String networkPath,
                                             String countryName,
                                             org.goplanit.xml.generated.XMLElementServiceNetwork xmlRawServiceNetwork)
        Constructor
        Parameters:
        networkPath - to persist network on
        countryName - to optimise projection for (if available, otherwise ignore)
        xmlRawServiceNetwork - to populate with PLANit service network when persisting
    • Method Detail

      • createAndPopulateXmlNetworkLayer

        protected org.goplanit.xml.generated.XMLElementServiceNetworkLayer createAndPopulateXmlNetworkLayer​(ServiceNetworkLayer serviceNetworkLayer,
                                                                                                            ServiceNetwork serviceNetwork)
        Populate the network layer
        Parameters:
        serviceNetworkLayer - to populate from
        serviceNetwork - to extract from
        Returns:
        populated new instance of service network layer, may be null in case no PLANit modes are supported for example
      • populateXmlServiceNetworkLayers

        protected void populateXmlServiceNetworkLayers​(ServiceNetwork serviceNetwork)
        Populate the available service network layers
        Parameters:
        serviceNetwork - to extract layers from and populate xml
      • populateTopLevelElement

        protected void populateTopLevelElement​(ServiceNetwork serviceNetwork)
        Populate the top level XML element for the service network and include parent network reference. In case no XML id is set, attempt to salvage with internal id's and log warnings for user verification of correctness.
        Parameters:
        serviceNetwork - to use
      • reset

        public void reset()
        reset the reader to allow for marking unnecessary resources for garbage collection
        Specified by:
        reset in interface ConverterEntity
      • getCountryName

        public String getCountryName()
        the country name of the network to write (if any is set)
        Returns:
        country name, null if unknown