Package moss
Class TableWriter
java.lang.Object
java.io.Writer
java.io.BufferedWriter
moss.TableWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
- Direct Known Subclasses:
GraphWriter
Class for writers for simple table formats for graph data sets.
- Since:
- 2007.03.04
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected char
the field separatorprotected static final String[][]
the field names for the different file typesprotected char
the record separator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setChars
(char recsep, char fldsep) Set the record and field separators.void
writeField
(double field, boolean last) Write a field (double).void
writeField
(int field, boolean last) Write a field (int).void
writeField
(String field, boolean last) Write a field (string).
-
Field Details
-
HEADER
the field names for the different file types -
recsep
protected char recsepthe record separator -
fldsep
protected char fldsepthe field separator
-
-
Constructor Details
-
TableWriter
Create a simple table format writer.- Parameters:
writer
- the writer to write to- Since:
- 2007.03.04 (Christian Borgelt)
-
-
Method Details
-
setChars
public void setChars(char recsep, char fldsep) Set the record and field separators.- Parameters:
recsep
- the record separatorfldsep
- the field separator- Since:
- 2007.06.26 (Christian Borgelt)
-
writeField
Write a field (string).- Parameters:
field
- the field to writelast
- whether this is the last field in a record- Throws:
IOException
- if writing the field failed- Since:
- 2020.10.23 (Christian Borgelt)
-
writeField
Write a field (int).- Parameters:
field
- the field to writelast
- whether this is the last field in a record- Throws:
IOException
- if writing the field failed- Since:
- 2020.10.23 (Christian Borgelt)
-
writeField
Write a field (double).- Parameters:
field
- the field to writelast
- whether this is the last field in a record- Throws:
IOException
- if writing the field failed- Since:
- 2020.10.23 (Christian Borgelt)
-