SSJ
3.3.1
Stochastic Simulation in Java
|
Text data writer. More...
Classes | |
enum | Format |
Output format: organize fields as columns or as rows. More... | |
Public Member Functions | |
TextDataWriter (String filename, Format format, boolean withHeaders) throws IOException | |
Class constructor. More... | |
TextDataWriter (File file, Format format, boolean withHeaders) throws IOException | |
Class constructor. More... | |
TextDataWriter (OutputStream outputStream, Format format, boolean withHeaders) throws IOException | |
Class constructor. More... | |
void | setFormat (Format format) |
Changes the output format. More... | |
void | setFloatFormatString (String formatString) |
Sets the format string used to output floating point numbers. More... | |
void | setColumnSeparator (String columnSeparator) |
Changes the column separator. | |
void | setHeaderPrefix (String headerPrefix) |
Changes the header prefix (a string that indicates the beginning of the header line for the COLUMNS format). | |
void | close () throws IOException |
Flushes any pending data and closes the file or stream. | |
Public Member Functions inherited from CachedDataWriter | |
CachedDataWriter () | |
Class constructor. | |
void | write (String label, String s) throws IOException |
Writes an atomic string field. More... | |
void | write (String label, int a) throws IOException |
Writes an atomic 32-bit integer (big endian). More... | |
void | write (String label, float a) throws IOException |
Writes an atomic 32-bit float (big endian). More... | |
void | write (String label, double a) throws IOException |
Writes an atomic 64-bit double (big endian). More... | |
void | write (String label, String[] a, int n) throws IOException |
Writes the first n elements of a one-dimensional array of strings. More... | |
void | write (String label, int[] a, int n) throws IOException |
Writes the first n elements of a one-dimensional array of 32-bit integers (big endian). More... | |
void | write (String label, float[] a, int n) throws IOException |
Writes the first n elements of a one-dimensional array of 32-bit floats (big endian). More... | |
void | write (String label, double[] a, int n) throws IOException |
Writes the first n elements of a one-dimensional array of 64-bit doubles (big endian). More... | |
void | write (String label, String[][] a) throws IOException |
Writes a two-dimensional array of strings. More... | |
void | write (String label, int[][] a) throws IOException |
Writes a two-dimensional array of 32-bit integers (big endian). More... | |
void | write (String label, float[][] a) throws IOException |
Writes a two-dimensional array of 32-bit floats (big endian). More... | |
void | write (String label, double[][] a) throws IOException |
Writes a two-dimensional array of 64-bit doubles (big endian). More... | |
Public Member Functions inherited from AbstractDataWriter | |
void | write (String label, String[] a) throws IOException |
Writes a one-dimensional array of strings. More... | |
void | write (String label, int[] a) throws IOException |
Writes a one-dimensional array of 32-bit integers (big endian). More... | |
void | write (String label, float[] a) throws IOException |
Writes a one-dimensional array of 32-bit floats (big endian). More... | |
void | write (String label, double[] a) throws IOException |
Writes a one-dimensional array of 64-bit doubles (big endian). More... | |
Writing atomic data | |
Writing one-dimensional arrays | |
Writing two-dimensional arrays | |
Other methods |
Fields | |
final String | DEFAULT_COLUMN_SEPARATOR = "\t" |
Default value for the column separator. | |
final String | DEFAULT_HEADER_PREFIX = "" |
Default value for the header prefix. | |
BufferedWriter | out |
Format | format |
boolean | withHeaders |
String | columnSeparator = DEFAULT_COLUMN_SEPARATOR |
String | headerPrefix = DEFAULT_HEADER_PREFIX |
String | floatFormatString = null |
int | getMaxFieldLength () |
Returns the maximum field length. | |
void | outputAsColumns () throws IOException |
Outputs fields as columns. | |
void | outputAsRows () throws IOException |
Outputs fields as rows. | |
void | writeFormat (Object o) throws IOException |
Formats the object in accordance with the current format strings settings. | |
Additional Inherited Members | |
Protected Member Functions inherited from CachedDataWriter | |
LinkedList< DataField > | getFields () |
Protected Attributes inherited from CachedDataWriter | |
LinkedList< DataField > | fields |
Text data writer.
Writes fields as columns or as rows in a text file.
TextDataWriter | ( | String | filename, |
Format | format, | ||
boolean | withHeaders | ||
) | throws IOException |
Class constructor.
Truncates any existing file with the specified name.
filename | name of the file to write to |
format | organize fields as columns if set to COLUMNS or as rows if set to ROWS |
withHeaders | output headers or not |
TextDataWriter | ( | File | file, |
Format | format, | ||
boolean | withHeaders | ||
) | throws IOException |
Class constructor.
Truncates any conflicting file.
file | file to write to |
format | organize fields as columns if set to COLUMNS or as rows if set to ROWS |
withHeaders | output headers or not |
TextDataWriter | ( | OutputStream | outputStream, |
Format | format, | ||
boolean | withHeaders | ||
) | throws IOException |
Class constructor.
outputStream | output stream to write to |
format | organize fields as columns if set to COLUMNS or as rows if set to ROWS |
withHeaders | output headers or not |
void setFloatFormatString | ( | String | formatString | ) |
Sets the format string used to output floating point numbers.
formatString | format string (e.g., %.4g ) |
void setFormat | ( | Format | format | ) |
Changes the output format.
format | organize fields as columns if set to COLUMNS or as rows if set to ROWS |