Class PlanitDemandsWriter
- java.lang.Object
-
- org.goplanit.converter.BaseWriterImpl<T>
-
- org.goplanit.converter.CrsWriterImpl<T>
-
- org.goplanit.io.converter.PlanitWriterImpl<Demands>
-
- org.goplanit.io.converter.demands.PlanitDemandsWriter
-
- All Implemented Interfaces:
ConverterEntity
,ConverterWriter<Demands>
,DemandsWriter
public class PlanitDemandsWriter extends PlanitWriterImpl<Demands> implements DemandsWriter
A class that takes a PLANit demands and persists it to file in the PLANit native XML format.- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.converter.BaseWriterImpl
idMapper
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PlanitDemandsWriter(PlanitDemandsWriterSettings settings, org.goplanit.xml.generated.XMLElementMacroscopicDemand xmlRawDemands)
Constructorprotected
PlanitDemandsWriter(PlanitDemandsWriterSettings settings, Zoning referenceZoning, org.goplanit.xml.generated.XMLElementMacroscopicDemand xmlRawDemands)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DemandsIdMapper
getPrimaryIdMapper()
The (main) Id mapper used by this writer (only present after write has been completed)Zoning
getReferenceZoning()
PlanitDemandsWriterSettings
getSettings()
any settings to configure the writer can be configured by collecting these settingsvoid
reset()
reset the reader to allow for marking unnecessary resources for garbage collectionvoid
setReferenceZoning(Zoning referenceZoning)
each demands writer is expected to ensure that its demand relate to a zoning this reference zoning can be set.void
write(Demands demands)
write a network to the writer's output format.-
Methods inherited from class org.goplanit.io.converter.PlanitWriterImpl
getSettingsAsXmlWriterSettings, getXmlModeReference, persist
-
Methods inherited from class org.goplanit.converter.CrsWriterImpl
createTransformedCoordinate, extractSrsName, getDestinationCoordinateReferenceSystem, getDestinationCrsTransformer, getGeoUtils, getTransformedCoordinates, prepareCoordinateReferenceSystem
-
Methods inherited from class org.goplanit.converter.BaseWriterImpl
getComponentIdMappers, getIdMapperType, setIdMapperType, setParentIdMappers
-
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.ConverterWriter
getIdMapperType, setIdMapperType
-
Methods inherited from interface org.goplanit.converter.demands.DemandsWriter
getTypeDescription
-
-
-
-
Constructor Detail
-
PlanitDemandsWriter
protected PlanitDemandsWriter(PlanitDemandsWriterSettings settings, org.goplanit.xml.generated.XMLElementMacroscopicDemand xmlRawDemands)
Constructor- Parameters:
settings
- to usexmlRawDemands
- to populate and persist
-
PlanitDemandsWriter
protected PlanitDemandsWriter(PlanitDemandsWriterSettings settings, Zoning referenceZoning, org.goplanit.xml.generated.XMLElementMacroscopicDemand xmlRawDemands)
Constructor- Parameters:
settings
- to usereferenceZoning
- to usexmlRawDemands
- to populate and persist
-
-
Method Detail
-
getPrimaryIdMapper
public DemandsIdMapper getPrimaryIdMapper()
The (main) Id mapper used by this writer (only present after write has been completed)- Specified by:
getPrimaryIdMapper
in classBaseWriterImpl<Demands>
- Returns:
- mapper
-
write
public void write(Demands demands) throws PlanItException
write a network to the writer's output format.- Specified by:
write
in interfaceConverterWriter<Demands>
- Parameters:
demands
- entity to write- Throws:
PlanItException
- thrown if error
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
reset
in interfaceConverterEntity
-
getSettings
public PlanitDemandsWriterSettings getSettings()
any settings to configure the writer can be configured by collecting these settings- Specified by:
getSettings
in interfaceConverterWriter<Demands>
- Returns:
- the settings to configure the writer
-
setReferenceZoning
public void setReferenceZoning(Zoning referenceZoning)
each demands writer is expected to ensure that its demand relate to a zoning this reference zoning can be set. To avoid the user having to do this manualy when using a converter, the converter will do this for the user. This in turn requires a mechanism on each demands writer to provide the reference zoning to the demands writer. This is what this method does.- Specified by:
setReferenceZoning
in interfaceDemandsWriter
- Parameters:
referenceZoning
- to supply demands writer with (before invokingConverterWriter.write(Object)
-
getReferenceZoning
public Zoning getReferenceZoning()
- Specified by:
getReferenceZoning
in interfaceDemandsWriter
-
-