Package org.goplanit.io.converter.zoning
Class PlanitZoningReader
- java.lang.Object
-
- org.goplanit.converter.BaseReaderImpl<Zoning>
-
- org.goplanit.io.converter.zoning.PlanitZoningReader
-
- All Implemented Interfaces:
ConverterEntity
,ConverterReader<Zoning>
,ZoningReader
public class PlanitZoningReader extends BaseReaderImpl<Zoning> implements ZoningReader
Class to parse zoning from native XML format- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected TransportLayerNetwork<?,?>
network
the network this zoning relates toprotected PlanitZoningReaderSettings
settings
settings for the zoning readerprotected Zoning
zoning
the zoning to populatestatic String
ZONING_XSD_FILE
Reference to zoning schema location, TODO: move to properties file-
Fields inherited from class org.goplanit.converter.BaseReaderImpl
sourceIdTrackerMap
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PlanitZoningReader(String pathDirectory, String xmlFileExtension, TransportLayerNetwork<?,?> network, Zoning zoning)
Constructorprotected
PlanitZoningReader(PlanitZoningReaderSettings settings, TransportLayerNetwork<?,?> network, Zoning zoning)
Constructorprotected
PlanitZoningReader(org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlMacroscopicZoning, TransportLayerNetwork<?,?> network, Zoning zoning)
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 PlanitZoningReaderSettings
getSettings()
Settings for this readerprotected void
populateIntermodal(Modes modes)
Parse the intermodal zones, i.e., platforms, stops, stations, etc.protected void
populateODZones()
Parse the OD zones from Xml element into Planit memoryZoning
read()
Read the zoning from diskvoid
reset()
reset the reader to allow for marking unnecessary resources for garbage collectionprotected void
setNetwork(TransportLayerNetwork<?,?> network)
Set the network to utiliseprotected void
setZoning(Zoning zoning)
Set the zoning to populate-
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.zoning.ZoningReader
getTypeDescription
-
-
-
-
Field Detail
-
settings
protected final PlanitZoningReaderSettings settings
settings for the zoning reader
-
zoning
protected Zoning zoning
the zoning to populate
-
network
protected TransportLayerNetwork<?,?> network
the network this zoning relates to
-
ZONING_XSD_FILE
public static final String ZONING_XSD_FILE
Reference to zoning schema location, TODO: move to properties file- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PlanitZoningReader
protected PlanitZoningReader(PlanitZoningReaderSettings settings, TransportLayerNetwork<?,?> network, Zoning zoning)
Constructor- Parameters:
settings
- to usenetwork
- to extract PLANit entities from by found references in zoningzoning
- to populate
-
PlanitZoningReader
protected PlanitZoningReader(String pathDirectory, String xmlFileExtension, TransportLayerNetwork<?,?> network, Zoning zoning) throws PlanItException
Constructor- Parameters:
pathDirectory
- to usexmlFileExtension
- to usenetwork
- to extract planit entities from by found references in zoningzoning
- to populate- Throws:
PlanItException
- thrown if error
-
PlanitZoningReader
protected PlanitZoningReader(org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlMacroscopicZoning, TransportLayerNetwork<?,?> network, Zoning zoning) throws PlanItException
Constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model- Parameters:
xmlMacroscopicZoning
- to extract fromnetwork
- to extract planit entities from by found references in zoningzoning
- to populate- Throws:
PlanItException
- thrown if error
-
-
Method Detail
-
populateIntermodal
protected void populateIntermodal(Modes modes) throws PlanItException
Parse the intermodal zones, i.e., platforms, stops, stations, etc. from XML element into PLANit memory- Parameters:
modes
- that can be referred to- Throws:
PlanItException
- thrown if error
-
setZoning
protected void setZoning(Zoning zoning)
Set the zoning to populate- Parameters:
zoning
- to populate
-
setNetwork
protected void setNetwork(TransportLayerNetwork<?,?> network)
Set the network to utilise- Parameters:
network
- to use
-
populateODZones
protected void populateODZones() throws PlanItException
Parse the OD zones from Xml element into Planit memory- Throws:
PlanItException
- thrown if error
-
read
public Zoning read() throws PlanItException
Read the zoning from disk- Specified by:
read
in interfaceConverterReader<Zoning>
- Returns:
- zoning parsed
- Throws:
PlanItException
- thrown if error
-
getSettings
public PlanitZoningReaderSettings getSettings()
Settings for this reader- Specified by:
getSettings
in interfaceConverterReader<Zoning>
- Returns:
- settings
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
reset
in interfaceConverterEntity
-
-