public class CsvWritter extends Object
Modifier and Type | Field and Description |
---|---|
int |
decPlaces
Decimal places.
|
String |
delimiter
Column delimiter.
|
Constructor and Description |
---|
CsvWritter()
Create empty file with random name in temporary folder.
|
CsvWritter(Path path,
String... header)
Create file and fill first line with header.
|
Modifier and Type | Method and Description |
---|---|
CsvWritter |
appendDelim()
Add current delimiter to line.
|
CsvWritter |
appendLine(Double... doubles)
Write series of Doubles using defined precision and default delimiter.
|
CsvWritter |
appendLine(String line)
Write line to file.
|
void |
close()
Close stream.
|
Path |
getPath()
Return file path.
|
PrintWriter |
getPw()
Return PrintWritter object.
|
CsvWritter |
writeLine(Double... doubles)
Write series of Doubles using defined precision and default delimiter.
|
CsvWritter |
writeLine(String line)
Write line to file.
|
public String delimiter
public int decPlaces
public CsvWritter() throws IOException
IOException
- on file errorpublic CsvWritter(Path path, String... header) throws IOException
close()
at the end.path
- path to fileheader
- header, null/empty value will skip header. Delimiter added automaticallyIOException
- on file errorclose()
public CsvWritter writeLine(String line)
line
- line to write.public CsvWritter writeLine(Double... doubles)
doubles
- numbers to write.close()
public CsvWritter appendLine(String line)
line
- line to write.appendDelim()
,
close()
public CsvWritter appendLine(Double... doubles)
doubles
- numbers to write.close()
,
appendDelim()
public CsvWritter appendDelim()
public PrintWriter getPw()
close()
public Path getPath()
public void close()
Copyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.