Class PlanitServiceNetworkReader
- java.lang.Object
-
- org.goplanit.converter.BaseReaderImpl<TransportLayerNetwork<?,?>>
-
- org.goplanit.converter.network.NetworkReaderImpl
-
- org.goplanit.io.converter.service.PlanitServiceNetworkReader
-
- All Implemented Interfaces:
ConverterEntity
,ConverterReader<TransportLayerNetwork<?,?>>
,NetworkReader
,ServiceNetworkReader
public class PlanitServiceNetworkReader extends NetworkReaderImpl implements ServiceNetworkReader
Implementation of a service network reader in the PLANit XML native format- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static String
SERVICE_NETWORK_XSD_FILE
Default XSD files used to validate input XML files against, TODO: move to properties file-
Fields inherited from class org.goplanit.converter.BaseReaderImpl
sourceIdTrackerMap
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PlanitServiceNetworkReader(String networkPathDirectory, String xmlFileExtension, ServiceNetwork serviceNetwork)
Constructorprotected
PlanitServiceNetworkReader(PlanitServiceNetworkReaderSettings settings, ServiceNetwork serviceNetwork)
Constructor where settings and service network are directly providedprotected
PlanitServiceNetworkReader(IdGroupingToken idToken, PlanitServiceNetworkReaderSettings settings)
Constructor where settings are directly provided such that input information can be extracted from itprotected
PlanitServiceNetworkReader(org.goplanit.xml.generated.XMLElementServiceNetwork populatedXmlRawServiceNetwork, ServiceNetwork serviceNetwork)
Constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlanitServiceNetworkReaderSettings
getSettings()
any settings to configure the reader can be configured by collecting these settingsServiceNetwork
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 org.goplanit.converter.BaseReaderImpl
getBySourceId, getSourceIdContainer, initialiseSourceIdMap, initialiseSourceIdMap, registerBySourceId, registerBySourceId
-
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.service.ServiceNetworkReader
getTypeDescription
-
-
-
-
Field Detail
-
SERVICE_NETWORK_XSD_FILE
public static final String SERVICE_NETWORK_XSD_FILE
Default XSD files used to validate input XML files against, TODO: move to properties file- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PlanitServiceNetworkReader
protected PlanitServiceNetworkReader(IdGroupingToken idToken, PlanitServiceNetworkReaderSettings settings) throws PlanItException
Constructor where settings are directly provided such that input information can be extracted from it- Parameters:
idToken
- to use for the service network to populatesettings
- to use- Throws:
PlanItException
- thrown if error
-
PlanitServiceNetworkReader
protected PlanitServiceNetworkReader(PlanitServiceNetworkReaderSettings settings, ServiceNetwork serviceNetwork) throws PlanItException
Constructor where settings and service network are directly provided- Parameters:
settings
- to useserviceNetwork
- to populate- Throws:
PlanItException
- thrown if error
-
PlanitServiceNetworkReader
protected PlanitServiceNetworkReader(org.goplanit.xml.generated.XMLElementServiceNetwork populatedXmlRawServiceNetwork, ServiceNetwork serviceNetwork) throws PlanItException
Constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model- Parameters:
populatedXmlRawServiceNetwork
- to extract fromserviceNetwork
- to populate- Throws:
PlanItException
- thrown if error
-
PlanitServiceNetworkReader
protected PlanitServiceNetworkReader(String networkPathDirectory, String xmlFileExtension, ServiceNetwork serviceNetwork) throws PlanItException
Constructor- Parameters:
networkPathDirectory
- to usexmlFileExtension
- to useserviceNetwork
- to populate- Throws:
PlanItException
- thrown if error
-
-
Method Detail
-
read
public ServiceNetwork read() throws PlanItException
parse the network based on the configuration of the implementing class to yield a PLANit network- Specified by:
read
in interfaceConverterReader<TransportLayerNetwork<?,?>>
- Returns:
- parsed network
- Throws:
PlanItException
- thrown if error
-
getSettings
public PlanitServiceNetworkReaderSettings getSettings()
any settings to configure the reader can be configured by collecting these settings- Specified by:
getSettings
in interfaceConverterReader<TransportLayerNetwork<?,?>>
- Returns:
- the settings to configrue the reader
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
reset
in interfaceConverterEntity
-
-