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 LayeredNetwork<?,?>
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
sourceIdTracker
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PlanitZoningReader(String pathDirectory, String xmlFileExtension, LayeredNetwork<?,?> network, Zoning zoning)
Constructorprotected
PlanitZoningReader(PlanitZoningReaderSettings settings, NetworkReader networkReader)
Constructorprotected
PlanitZoningReader(PlanitZoningReaderSettings settings, LayeredNetwork<?,?> network, Zoning zoning)
Constructorprotected
PlanitZoningReader(org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlMacroscopicZoning, PlanitZoningReaderSettings settings, LayeredNetwork<?,?> network, Zoning zoning)
Constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory modelprotected
PlanitZoningReader(org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlMacroscopicZoning, LayeredNetwork<?,?> 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 LayeredNetwork<?,?>
getReferenceNetwork()
Access to reference network usedPlanitZoningReaderSettings
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
setReferenceNetwork(LayeredNetwork<?,?> 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 LayeredNetwork<?,?> 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, NetworkReader networkReader)
Constructor- Parameters:
settings
- to usenetworkReader
- to construct reference network from
-
PlanitZoningReader
protected PlanitZoningReader(PlanitZoningReaderSettings settings, LayeredNetwork<?,?> 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, LayeredNetwork<?,?> network, Zoning zoning)
Constructor- Parameters:
pathDirectory
- to usexmlFileExtension
- to usenetwork
- to extract planit entities from by found references in zoningzoning
- to populate
-
PlanitZoningReader
protected PlanitZoningReader(org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlMacroscopicZoning, LayeredNetwork<?,?> network, Zoning zoning)
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
-
PlanitZoningReader
protected PlanitZoningReader(org.goplanit.xml.generated.XMLElementMacroscopicZoning xmlMacroscopicZoning, PlanitZoningReaderSettings settings, LayeredNetwork<?,?> network, Zoning zoning)
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 fromsettings
- to usenetwork
- to extract planit entities from by found references in zoningzoning
- to populate
-
-
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
-
setReferenceNetwork
protected void setReferenceNetwork(LayeredNetwork<?,?> network)
Set the network to utilise- Parameters:
network
- to use
-
populateODZones
protected void populateODZones()
Parse the OD zones from Xml element into Planit memory
-
read
public Zoning read()
Read the zoning from disk- Specified by:
read
in interfaceConverterReader<Zoning>
- Returns:
- zoning parsed
-
getSettings
public PlanitZoningReaderSettings getSettings()
Settings for this reader- Specified by:
getSettings
in interfaceConverterReader<Zoning>
- Returns:
- settings
-
getReferenceNetwork
public LayeredNetwork<?,?> getReferenceNetwork()
Access to reference network used- Returns:
- reference network
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
reset
in interfaceConverterEntity
- Overrides:
reset
in classBaseReaderImpl<Zoning>
-
-