Class PlanitIntermodalReader
- java.lang.Object
-
- org.goplanit.io.converter.intermodal.PlanitIntermodalReader
-
- All Implemented Interfaces:
ConverterEntity
,IntermodalReader
,MultiConverterReader<MacroscopicNetwork,Zoning>
public class PlanitIntermodalReader extends Object implements IntermodalReader
Planit intermodal reader in native format. Wraps a network and zoning reader in one- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected PlanitIntermodalReaderSettings
intermodalReaderSettings
intermodal reader settings to useprotected MacroscopicNetwork
networkToPopulate
the network to populateprotected Zoning
zoningToPopulate
the zoning to populate
-
Constructor Summary
Constructors Modifier Constructor Description protected
PlanitIntermodalReader(String inputPathDirectory, String xmlFileExtension, MacroscopicNetwork network, Zoning zoning)
constructor where xml content is still on disk and first needs to be parsed into memory before converted to planit memory modelprotected
PlanitIntermodalReader(String inputPathDirectory, String xmlFileExtension, IdGroupingToken idToken)
constructor where xml content is still on disk and first needs to be parsed into memory before converted to planit memory model.protected
PlanitIntermodalReader(PlanitIntermodalReaderSettings settings, IdGroupingToken idToken)
constructor where xml content is still on disk and first needs to be parsed into memory before converted to planit memory model.PlanitIntermodalReader(org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork, org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlRawZoning, MacroscopicNetwork network, Zoning zoning)
constructor where the xml content has already been parsed into a JAXB memory model which subsequently needs to be converted into the planit memory model
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlanitIntermodalReaderSettings
getSettings()
any settings to configure the reader can be configured by collecting these settingsPair<MacroscopicNetwork,Zoning>
read()
parse the network based on the configuration of the implementing class to yield a PLANit networkvoid
reset()
reset the reader to allow for marking unnecessary resources for garbage collection-
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.IntermodalReader
getTypeDescription
-
-
-
-
Field Detail
-
intermodalReaderSettings
protected final PlanitIntermodalReaderSettings intermodalReaderSettings
intermodal reader settings to use
-
zoningToPopulate
protected final Zoning zoningToPopulate
the zoning to populate
-
networkToPopulate
protected final MacroscopicNetwork networkToPopulate
the network to populate
-
-
Constructor Detail
-
PlanitIntermodalReader
protected PlanitIntermodalReader(String inputPathDirectory, String xmlFileExtension, IdGroupingToken idToken) throws PlanItException
constructor where xml content is still on disk and first needs to be parsed into memory before converted to planit memory model. Network and zoning instance are created internally and returned upon completion- Parameters:
inputPathDirectory
- to use for both network and zoning input file assuming default input file names for both (network.xml, zoning.xml) *xmlFileExtension
- to useidToken
- to use for the network and zoning that are to be created- Throws:
PlanItException
- thrown if error
-
PlanitIntermodalReader
protected PlanitIntermodalReader(PlanitIntermodalReaderSettings settings, IdGroupingToken idToken) throws PlanItException
constructor where xml content is still on disk and first needs to be parsed into memory before converted to planit memory model. Network and zoning instance are created internally and returned upon completion- Parameters:
settings
- to useidToken
- to use for the network and zoning that are to be created- Throws:
PlanItException
- thrown if error
-
PlanitIntermodalReader
protected PlanitIntermodalReader(String inputPathDirectory, String xmlFileExtension, MacroscopicNetwork network, Zoning zoning) throws PlanItException
constructor where xml content is still on disk and first needs to be parsed into memory before converted to planit memory model- Parameters:
inputPathDirectory
- to use for both network and zoning input file assuming default input file names for both (network.xml, zoning.xml) *xmlFileExtension
- to usenetwork
- to populatezoning
- to populate- Throws:
PlanItException
- thrown if error
-
PlanitIntermodalReader
public PlanitIntermodalReader(org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork, org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlRawZoning, MacroscopicNetwork network, Zoning zoning) throws PlanItException
constructor where the xml content has already been parsed into a JAXB memory model which subsequently needs to be converted into the planit memory model- Parameters:
xmlRawNetwork
- to extract fromxmlRawZoning
- to extract fromnetwork
- to extract referenced entities fromzoning
- to populate- Throws:
PlanItException
- thrown if error
-
-
Method Detail
-
read
public Pair<MacroscopicNetwork,Zoning> read() throws PlanItException
parse the network based on the configuration of the implementing class to yield a PLANit network- Specified by:
read
in interfaceMultiConverterReader<MacroscopicNetwork,Zoning>
- Returns:
- parsed entities
- Throws:
PlanItException
- thrown if error
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
reset
in interfaceConverterEntity
-
getSettings
public PlanitIntermodalReaderSettings getSettings()
any settings to configure the reader can be configured by collecting these settings- Specified by:
getSettings
in interfaceMultiConverterReader<MacroscopicNetwork,Zoning>
- Returns:
- the settings to configrue the reader
-
-