Class TntpDemandsReader
- java.lang.Object
-
- org.goplanit.converter.BaseReaderImpl<Demands>
-
- org.goplanit.tntp.converter.demands.TntpDemandsReader
-
- All Implemented Interfaces:
ConverterEntity
,ConverterReader<Demands>
,DemandsReader
public class TntpDemandsReader extends BaseReaderImpl<Demands> implements DemandsReader
Demands reader component for TNTP data format- Author:
- gman, markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.converter.BaseReaderImpl
sourceIdTracker
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TntpDemandsReader(TntpDemandsReaderSettings settings, MacroscopicNetwork referenceNetwork, Zoning referenceZoning, Demands demandsToPopulate)
Constructorprotected
TntpDemandsReader(TntpDemandsReaderSettings settings, TntpZoningReader referenceZoningReader)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MacroscopicNetwork
getReferenceNetwork()
Zoning
getReferenceZoning()
each demands reader is expected to ensure that its demand relates to a zoning this reference zoning can be obtained (after reading is complete).TntpDemandsReaderSettings
getSettings()
any settings to configure the reader can be configured by collecting these settingsDemands
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.demands.DemandsReader
getTypeDescription
-
-
-
-
Constructor Detail
-
TntpDemandsReader
protected TntpDemandsReader(TntpDemandsReaderSettings settings, MacroscopicNetwork referenceNetwork, Zoning referenceZoning, Demands demandsToPopulate)
Constructor- Parameters:
settings
- to usereferenceNetwork
- to usereferenceZoning
- to usedemandsToPopulate
- to use
-
TntpDemandsReader
protected TntpDemandsReader(TntpDemandsReaderSettings settings, TntpZoningReader referenceZoningReader)
Constructor- Parameters:
settings
- to usereferenceZoningReader
- to use
-
-
Method Detail
-
getSettings
public TntpDemandsReaderSettings getSettings()
any settings to configure the reader can be configured by collecting these settings- Specified by:
getSettings
in interfaceConverterReader<Demands>
- Returns:
- the settings to configrue the reader
-
read
public Demands read()
parse the network based on the configuration of the implementing class to yield a PLANit network- Specified by:
read
in interfaceConverterReader<Demands>
- Returns:
- parsed network
-
getReferenceNetwork
public MacroscopicNetwork getReferenceNetwork()
-
getReferenceZoning
public Zoning getReferenceZoning()
Description copied from interface:DemandsReader
each demands reader is expected to ensure that its demand relates to a zoning this reference zoning can be obtained (after reading is complete). the converter uses this to avoid the user having to manually transfer this zoning to the writer which also requires this same zoning consistency This is what this method enables- Specified by:
getReferenceZoning
in interfaceDemandsReader
- Returns:
- referenceZoning to supply demands writer with (after invoking
ConverterReader.read()
-
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<Demands>
-
-