org.jscience.io
Class TextWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.OutputStreamWriter
          extended by org.jscience.io.TextWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public final class TextWriter
extends java.io.OutputStreamWriter

Text writer, writes data text files/streams. This class uses buffered I/O.


Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
TextWriter(java.io.File file, char ch)
          Writes to a text file with the specified File object.
TextWriter(java.io.OutputStream stream)
          Writes text data to an output stream.
TextWriter(java.lang.String name, char ch)
          Writes to a text file with the specified system dependent file name.
 
Method Summary
 void close()
          Close the stream.
 void write(double[] data)
          Writes an array of data.
 void write(double[][] data)
          Writes an array of data.
 void write(DoubleMatrix matrix)
          Writes a matrix.
 void write(int c)
          Writes a single character.
 void write(int[] data)
          Writes an array of data.
 void write(int[][] data)
          Writes an array of data.
 void write(IntegerMatrix matrix)
          Writes a matrix.
 void write(java.lang.String str)
          Writes a string.
 
Methods inherited from class java.io.OutputStreamWriter
flush, getEncoding, write, write
 
Methods inherited from class java.io.Writer
append, append, append, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextWriter

public TextWriter(java.io.OutputStream stream)
Writes text data to an output stream.

Parameters:
stream - DOCUMENT ME!

TextWriter

public TextWriter(java.lang.String name,
                  char ch)
           throws java.io.IOException
Writes to a text file with the specified system dependent file name.

Parameters:
name - the system dependent file name.
ch - the character that delimits data columns.
Throws:
java.io.IOException - If the file is not found.

TextWriter

public TextWriter(java.io.File file,
                  char ch)
           throws java.io.IOException
Writes to a text file with the specified File object.

Parameters:
file - the file to be opened for writing.
ch - the character that delimits data columns.
Throws:
java.io.IOException - If the file is not found.
Method Detail

write

public void write(int c)
           throws java.io.IOException
Writes a single character.

Overrides:
write in class java.io.OutputStreamWriter
Parameters:
c - DOCUMENT ME!
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(java.lang.String str)
           throws java.io.IOException
Writes a string.

Overrides:
write in class java.io.Writer
Parameters:
str - DOCUMENT ME!
Throws:
java.io.IOException - If an I/O error occurs.

close

public void close()
           throws java.io.IOException
Close the stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStreamWriter
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(double[] data)
           throws java.io.IOException
Writes an array of data.

Parameters:
data - the data to be written.
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(double[][] data)
           throws java.io.IOException
Writes an array of data.

Parameters:
data - the data to be written.
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(int[] data)
           throws java.io.IOException
Writes an array of data.

Parameters:
data - the data to be written.
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(int[][] data)
           throws java.io.IOException
Writes an array of data.

Parameters:
data - the data to be written.
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(DoubleMatrix matrix)
           throws java.io.IOException
Writes a matrix.

Parameters:
matrix - the matrix to be written.
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(IntegerMatrix matrix)
           throws java.io.IOException
Writes a matrix.

Parameters:
matrix - the matrix to be written.
Throws:
java.io.IOException - If an I/O error occurs.