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 StringROUTED_SERVICES_XSD_FILEDefault XSD files used to validate input XML files against, TODO: move to properties file-
Fields inherited from class org.goplanit.converter.BaseReaderImpl
sourceIdTracker
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPlanitRoutedServicesReader(String inputPathDirectory, String xmlFileExtension, RoutedServices routedServices)ConstructorprotectedPlanitRoutedServicesReader(PlanitRoutedServicesReaderSettings settings, RoutedServices routedServices)Constructor where settings and routed services to populate are directly providedprotectedPlanitRoutedServicesReader(IdGroupingToken idToken, ServiceNetwork parentServiceNetwork, PlanitRoutedServicesReaderSettings settings)Constructor where settings are directly provided such that input information can be extracted from itprotectedPlanitRoutedServicesReader(org.goplanit.xml.generated.XMLElementRoutedServices populatedXmlRawRoutedServices, PlanitRoutedServicesReaderSettings settings, RoutedServices routedServices)Constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory modelprotectedPlanitRoutedServicesReader(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 PlanitRoutedServicesReaderSettingsgetSettings()any settings to configure the reader can be configured by collecting these settingsRoutedServicesread()parse the network based on the configuration of the implementing class to yield a PLANit networkvoidreset()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, ServiceNetwork parentServiceNetwork, 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 populateparentServiceNetwork- to usesettings- to use- Throws:
PlanItException- thrown if error
-
PlanitRoutedServicesReader
protected PlanitRoutedServicesReader(PlanitRoutedServicesReaderSettings settings, RoutedServices routedServices)
Constructor where settings and routed services to populate are directly provided- Parameters:
settings- to useroutedServices- to populate
-
PlanitRoutedServicesReader
protected 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- Parameters:
populatedXmlRawRoutedServices- to extract fromroutedServices- to populate
-
PlanitRoutedServicesReader
protected PlanitRoutedServicesReader(org.goplanit.xml.generated.XMLElementRoutedServices populatedXmlRawRoutedServices, PlanitRoutedServicesReaderSettings settings, RoutedServices routedServices)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 fromsettings- to useroutedServices- to populate
-
PlanitRoutedServicesReader
protected PlanitRoutedServicesReader(String inputPathDirectory, String xmlFileExtension, RoutedServices routedServices)
Constructor- Parameters:
inputPathDirectory- to usexmlFileExtension- to useroutedServices- to populate
-
-
Method Detail
-
read
public RoutedServices read()
parse the network based on the configuration of the implementing class to yield a PLANit network- Specified by:
readin interfaceConverterReader<RoutedServices>- Returns:
- parsed network
-
getSettings
public PlanitRoutedServicesReaderSettings getSettings()
any settings to configure the reader can be configured by collecting these settings- Specified by:
getSettingsin 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:
resetin interfaceConverterEntity- Overrides:
resetin classBaseReaderImpl<RoutedServices>
-
-