Class PlanitRoutedServicesReader
- java.lang.Object
-
- org.goplanit.converter.BaseReaderImpl<RoutedServices>
-
- org.goplanit.io.converter.service.PlanitRoutedServicesReader
-
- All Implemented Interfaces:
ConverterEntity
,ConverterReader<RoutedServices>
,RoutedServicesReader
public class PlanitRoutedServicesReader extends BaseReaderImpl<RoutedServices> implements RoutedServicesReader
Implementation of a routed service reader in the PLANit XML native format- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static String
ROUTED_SERVICES_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
PlanitRoutedServicesReader(String inputPathDirectory, String xmlFileExtension, RoutedServices routedServices)
Constructorprotected
PlanitRoutedServicesReader(PlanitRoutedServicesReaderSettings settings, RoutedServices routedServices)
Constructor where settings and routed services to populate are directly providedprotected
PlanitRoutedServicesReader(IdGroupingToken idToken, PlanitRoutedServicesReaderSettings settings)
Constructor where settings are directly provided such that input information can be extracted from itprotected
PlanitRoutedServicesReader(org.goplanit.xml.generated.XMLElementRoutedServices populatedXmlRawRoutedServices, RoutedServices routedServices)
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 PlanitRoutedServicesReaderSettings
getSettings()
any settings to configure the reader can be configured by collecting these settingsRoutedServices
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.RoutedServicesReader
getTypeDescription
-
-
-
-
Field Detail
-
ROUTED_SERVICES_XSD_FILE
public static final String ROUTED_SERVICES_XSD_FILE
Default XSD files used to validate input XML files against, TODO: move to properties file- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PlanitRoutedServicesReader
protected PlanitRoutedServicesReader(IdGroupingToken idToken, PlanitRoutedServicesReaderSettings 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
-
PlanitRoutedServicesReader
protected PlanitRoutedServicesReader(PlanitRoutedServicesReaderSettings settings, RoutedServices routedServices) throws PlanItException
Constructor where settings and routed services to populate are directly provided- Parameters:
settings
- to useroutedServices
- to populate- Throws:
PlanItException
- thrown if error
-
PlanitRoutedServicesReader
protected PlanitRoutedServicesReader(org.goplanit.xml.generated.XMLElementRoutedServices populatedXmlRawRoutedServices, RoutedServices routedServices) throws PlanItException
Constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model- Parameters:
populatedXmlRawRoutedServices
- to extract fromroutedServices
- to populate- Throws:
PlanItException
- thrown if error
-
PlanitRoutedServicesReader
protected PlanitRoutedServicesReader(String inputPathDirectory, String xmlFileExtension, RoutedServices routedServices) throws PlanItException
Constructor- Parameters:
inputPathDirectory
- to usexmlFileExtension
- to useroutedServices
- to populate- Throws:
PlanItException
- thrown if error
-
-
Method Detail
-
read
public RoutedServices read() throws PlanItException
parse the network based on the configuration of the implementing class to yield a PLANit network- Specified by:
read
in interfaceConverterReader<RoutedServices>
- Returns:
- parsed network
- Throws:
PlanItException
- thrown if error
-
getSettings
public PlanitRoutedServicesReaderSettings getSettings()
any settings to configure the reader can be configured by collecting these settings- Specified by:
getSettings
in interfaceConverterReader<RoutedServices>
- 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
-
-