Class PlanitIntermodalWriter
- java.lang.Object
-
- org.goplanit.io.converter.intermodal.PlanitIntermodalWriter
-
- All Implemented Interfaces:
ConverterEntity,IntermodalWriter<ServiceNetwork,RoutedServices>,PairConverterWriter<MacroscopicNetwork,Zoning>
public class PlanitIntermodalWriter extends Object implements IntermodalWriter<ServiceNetwork,RoutedServices>
Planit intermodal writer for native Planit format, wrapping a planit network writer and planit zoning writer in one- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected IdMapperTypeidMapperthe id mapper to useprotected PlanitIntermodalWriterSettingssettingsintermodal writer settings to useprotected org.goplanit.xml.generated.XMLElementMacroscopicNetworkxmlRawNetworkxml element to populate network onprotected org.goplanit.xml.generated.XMLElementRoutedServicesxmlRawRoutedServicesxml element to populate routed services onprotected org.goplanit.xml.generated.XMLElementServiceNetworkxmlRawServiceNetworkxml element to populate service network onprotected org.goplanit.xml.generated.XMLElementMacroscopicZoningxmlRawZoningxml element to populate zoning on
-
Constructor Summary
Constructors Modifier Constructor Description protectedPlanitIntermodalWriter(String outputDirectory, String countryName, org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork, org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlRawZoning, org.goplanit.xml.generated.XMLElementServiceNetwork xmlRawServiceNetwork, org.goplanit.xml.generated.XMLElementRoutedServices xmlRawRoutedServices)ConstructorprotectedPlanitIntermodalWriter(PlanitIntermodalWriterSettings settings)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdMapperTypegetIdMapperType()collect the way the ids should be mappedPlanitIntermodalWriterSettingsgetSettings()Any settings to configure the writer can be configured by collecting these settingsvoidreset()reset the reader to allow for marking unnecessary resources for garbage collectionvoidsetIdMapperType(IdMapperType idMapper)set the way ids should be mappedvoidwrite(MacroscopicNetwork macroscopicNetwork, Zoning zoning)Write a network to the writer's output format.protected Pair<PlanitNetworkWriter,PlanitZoningWriter>writeNetworkAndZoning(MacroscopicNetwork macroscopicNetwork, Zoning zoning)Persist network and zoning and return writersvoidwriteWithServices(MacroscopicNetwork macroscopicNetwork, Zoning zoning, ServiceNetwork serviceNetwork, RoutedServices routedServices)Write a network to the writer's output format.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.converter.intermodal.IntermodalWriter
getTypeDescription
-
-
-
-
Field Detail
-
settings
protected final PlanitIntermodalWriterSettings settings
intermodal writer settings to use
-
xmlRawNetwork
protected final org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork
xml element to populate network on
-
xmlRawZoning
protected final org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlRawZoning
xml element to populate zoning on
-
xmlRawServiceNetwork
protected final org.goplanit.xml.generated.XMLElementServiceNetwork xmlRawServiceNetwork
xml element to populate service network on
-
xmlRawRoutedServices
protected final org.goplanit.xml.generated.XMLElementRoutedServices xmlRawRoutedServices
xml element to populate routed services on
-
idMapper
protected IdMapperType idMapper
the id mapper to use
-
-
Constructor Detail
-
PlanitIntermodalWriter
protected PlanitIntermodalWriter(String outputDirectory, String countryName, org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork, org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlRawZoning, org.goplanit.xml.generated.XMLElementServiceNetwork xmlRawServiceNetwork, org.goplanit.xml.generated.XMLElementRoutedServices xmlRawRoutedServices)
Constructor- Parameters:
outputDirectory- to persist oncountryName- to optimise projection for (if available, otherwise ignore)xmlRawNetwork- to populate with PLANit network when persistingxmlRawZoning- to populate with PLANit zoning when persistingxmlRawServiceNetwork- to populate with PLANit service network when persistingxmlRawRoutedServices- to populate with PLANit routed services when persisting
-
PlanitIntermodalWriter
protected PlanitIntermodalWriter(PlanitIntermodalWriterSettings settings)
Constructor- Parameters:
settings- to use
-
-
Method Detail
-
writeNetworkAndZoning
protected Pair<PlanitNetworkWriter,PlanitZoningWriter> writeNetworkAndZoning(MacroscopicNetwork macroscopicNetwork, Zoning zoning)
Persist network and zoning and return writers- Parameters:
macroscopicNetwork- to persistzoning- to persist- Returns:
- used writers, network and zoning, respectively
-
write
public void write(MacroscopicNetwork macroscopicNetwork, Zoning zoning) throws PlanItException
Write a network to the writer's output format.- Specified by:
writein interfacePairConverterWriter<MacroscopicNetwork,Zoning>- Parameters:
macroscopicNetwork- to writezoning- to write- Throws:
PlanItException- thrown if error
-
writeWithServices
public void writeWithServices(MacroscopicNetwork macroscopicNetwork, Zoning zoning, ServiceNetwork serviceNetwork, RoutedServices routedServices) throws PlanItException
Write a network to the writer's output format.- Specified by:
writeWithServicesin interfaceIntermodalWriter<ServiceNetwork,RoutedServices>- Parameters:
macroscopicNetwork- network to writezoning- to writeserviceNetwork- to writeroutedServices- to write- Throws:
PlanItException- thrown if error
-
getIdMapperType
public IdMapperType getIdMapperType()
collect the way the ids should be mapped- Specified by:
getIdMapperTypein interfacePairConverterWriter<MacroscopicNetwork,Zoning>- Returns:
- the id mapping choice
-
setIdMapperType
public void setIdMapperType(IdMapperType idMapper)
set the way ids should be mapped- Specified by:
setIdMapperTypein interfacePairConverterWriter<MacroscopicNetwork,Zoning>- Parameters:
idMapper- to use
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
resetin interfaceConverterEntity
-
getSettings
public PlanitIntermodalWriterSettings getSettings()
Any settings to configure the writer can be configured by collecting these settings- Specified by:
getSettingsin interfacePairConverterWriter<MacroscopicNetwork,Zoning>- Returns:
- the settings to configure the writer
-
-