Package org.goplanit.converter
Class BaseWriterImpl<T>
- java.lang.Object
-
- org.goplanit.converter.BaseWriterImpl<T>
-
- All Implemented Interfaces:
ConverterEntity
,ConverterWriter<T>
- Direct Known Subclasses:
CrsWriterImpl
public abstract class BaseWriterImpl<T> extends Object implements ConverterWriter<T>
abstract base class implementation to write a PLANit network to disk with id mapping sorted for convenience- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected IdMapperType
idMapper
the (primary) id mapper to use
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseWriterImpl(IdMapperType idMapperType)
constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected PlanitComponentIdMappers
getComponentIdMappers()
Access to the id mappers for each component via dedicated classIdMapperType
getIdMapperType()
collect the way the ids should be mappedabstract PlanitComponentIdMapper
getPrimaryIdMapper()
The (main) Id mapper used by this writer (only present after write has been completed)void
setIdMapperType(IdMapperType idMapper)
set the way ids should be mappedvoid
setParentIdMappers(PlanitComponentIdMapper... parentMappers)
The explicit id mapping to be used by the parent(s), so we use the appropriate referencing.-
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.ConverterEntity
getTypeDescription, reset
-
Methods inherited from interface org.goplanit.converter.ConverterWriter
getSettings, write
-
-
-
-
Field Detail
-
idMapper
protected IdMapperType idMapper
the (primary) id mapper to use
-
-
Constructor Detail
-
BaseWriterImpl
protected BaseWriterImpl(IdMapperType idMapperType)
constructor- Parameters:
idMapperType
- to use as default
-
-
Method Detail
-
getComponentIdMappers
protected PlanitComponentIdMappers getComponentIdMappers()
Access to the id mappers for each component via dedicated class- Returns:
- component id mappers container class
-
getIdMapperType
public IdMapperType getIdMapperType()
collect the way the ids should be mapped- Specified by:
getIdMapperType
in interfaceConverterWriter<T>
- Returns:
- the idmapping choice
-
setIdMapperType
public void setIdMapperType(IdMapperType idMapper)
set the way ids should be mapped- Specified by:
setIdMapperType
in interfaceConverterWriter<T>
- Parameters:
idMapper
- to use
-
getPrimaryIdMapper
public abstract PlanitComponentIdMapper getPrimaryIdMapper()
The (main) Id mapper used by this writer (only present after write has been completed)- Returns:
- mapper
-
setParentIdMappers
public void setParentIdMappers(PlanitComponentIdMapper... parentMappers)
The explicit id mapping to be used by the parent(s), so we use the appropriate referencing. These are to be set before writing commences, otherwise defaults based on the(primary) idMapperType will be instantiated and used instead.- Parameters:
parentMappers
- to register
-
-