Package com.powsybl.ampl.converter.util
Class AmplDatTableFormatter
- java.lang.Object
-
- com.powsybl.commons.io.table.AbstractTableFormatter
-
- com.powsybl.commons.io.table.CsvTableFormatter
-
- com.powsybl.ampl.converter.util.AmplDatTableFormatter
-
- All Implemented Interfaces:
TableFormatter
,AutoCloseable
public class AmplDatTableFormatter extends CsvTableFormatter
Specialization of CSV table formatter for AMPL .dat file generation. 3 differences: - separator is white space - comments are allowed and start with # (header is also a comment) - strings are quoted because of the white space separator- Author:
- Geoffroy Jamgotchian
-
-
Field Summary
-
Fields inherited from class com.powsybl.commons.io.table.CsvTableFormatter
headerDone, title
-
Fields inherited from class com.powsybl.commons.io.table.AbstractTableFormatter
column, columns, config, writer
-
-
Constructor Summary
Constructors Constructor Description AmplDatTableFormatter(Writer writer, String title, float invalidFloatValue, boolean writeHeader, Locale locale, Column... columns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TableFormatter
writeCell(String s)
TableFormatter
writeComment(String comment)
protected void
writeHeader()
-
Methods inherited from class com.powsybl.commons.io.table.CsvTableFormatter
close, write
-
Methods inherited from class com.powsybl.commons.io.table.AbstractTableFormatter
writeCell, writeCell, writeCell, writeCell, writeCell, writeEmptyCell, writeEmptyCells, writeEmptyLine, writeEmptyLines
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.powsybl.commons.io.table.TableFormatter
writeCell
-
-
-
-
Method Detail
-
writeHeader
protected void writeHeader() throws IOException
- Overrides:
writeHeader
in classCsvTableFormatter
- Throws:
IOException
-
writeCell
public TableFormatter writeCell(String s) throws IOException
- Specified by:
writeCell
in interfaceTableFormatter
- Overrides:
writeCell
in classAbstractTableFormatter
- Throws:
IOException
-
writeComment
public TableFormatter writeComment(String comment) throws IOException
- Specified by:
writeComment
in interfaceTableFormatter
- Overrides:
writeComment
in classCsvTableFormatter
- Throws:
IOException
-
-