Package org.planit.network.converter
Class NetworkConverter
- java.lang.Object
-
- org.planit.network.converter.NetworkConverter
-
public class NetworkConverter extends Object
Network converter class able to convert a network from one type to another- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected NetworkReaderreaderthe readerprotected NetworkWriterwriterthe writer
-
Constructor Summary
Constructors Modifier Constructor Description protectedNetworkConverter(NetworkReader reader, NetworkWriter writer)constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconvert()Convert the network parsed by the reader by passing it on to the writer.NetworkReadergetReader()get the readerNetworkWritergetWriter()get the writerprotected booleanisModeConversionValid()verify if mode conversion between reader and writer is valid
-
-
-
Field Detail
-
reader
protected final NetworkReader reader
the reader
-
writer
protected final NetworkWriter writer
the writer
-
-
Constructor Detail
-
NetworkConverter
protected NetworkConverter(NetworkReader reader, NetworkWriter writer)
constructor- Parameters:
reader- to use for parsingwriter- to use for persisting
-
-
Method Detail
-
isModeConversionValid
protected boolean isModeConversionValid()
verify if mode conversion between reader and writer is valid- Returns:
- true if valid, false otherwise
-
convert
public void convert() throws PlanItExceptionConvert the network parsed by the reader by passing it on to the writer. It is assumed both reader and writer are fully configured when this method is called- Throws:
PlanItException- thrown if error
-
getReader
public NetworkReader getReader()
get the reader- Returns:
- the reader
-
getWriter
public NetworkWriter getWriter()
get the writer- Returns:
- the writer
-
-