Package nz.org.riskscape.engine.output
Class CsvWriter
java.lang.Object
nz.org.riskscape.engine.output.RiskscapeWriter
nz.org.riskscape.engine.output.CsvWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class CsvWriter
extends nz.org.riskscape.engine.output.RiskscapeWriter
implements AutoCloseable
Very simple csv writer, to avoid the ceremony and geometry-required-ness of the geotools one. Quotes values with double quotes if they contain a double quote, a comma or a return character.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Per column character limit beyond which column content will be truncated. -
Constructor Summary
-
Method Summary
-
Field Details
-
COLUMN_MAX_CHARACTERS
public static final int COLUMN_MAX_CHARACTERSPer column character limit beyond which column content will be truncated. This is because Excel has a limit of 32,767 characters and will not display a file that contains columns that exceed that limit.
Ideally this would be configurable, but we have no facility for passing options to output formats (GL#420)
- See Also:
-
-
Constructor Details
-
CsvWriter
public CsvWriter(nz.org.riskscape.problem.ProblemSink problemSink, nz.org.riskscape.engine.resource.CreateHandle handle) -
CsvWriter
public CsvWriter(nz.org.riskscape.problem.ProblemSink problemSink, File file) throws FileNotFoundException - Throws:
FileNotFoundException
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
write
public void write(@NonNull @NonNull nz.org.riskscape.engine.Tuple value) - Specified by:
write
in classnz.org.riskscape.engine.output.RiskscapeWriter
-
write
protected boolean write(nz.org.riskscape.engine.types.Struct struct, nz.org.riskscape.engine.Tuple value, boolean first) throws IOException - Throws:
IOException
-
getStoredAt
- Specified by:
getStoredAt
in classnz.org.riskscape.engine.output.RiskscapeWriter
-