org.jqurantree.core.io
Class FileWriter

java.lang.Object
  extended by org.jqurantree.core.io.FileWriter

public class FileWriter
extends java.lang.Object

Utility class which supports writing to a file.

Author:
Kais Dukes

Constructor Summary
FileWriter(java.lang.String filename)
          Creates a new file writer by opening the specified file for writing.
 
Method Summary
 void close()
          Closes the resource.
 void write(char ch)
          Writes a character to the file.
 void write(java.lang.String text)
          Writes a string to the file
 void writeLine()
          Writes a line break to the file.
 void writeLine(java.lang.String text)
          Writes a new line of text to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileWriter

public FileWriter(java.lang.String filename)
Creates a new file writer by opening the specified file for writing.

Parameters:
filename - the path and name of the file, e.g. foo/bar.txt
Method Detail

write

public void write(char ch)
Writes a character to the file.

Parameters:
ch - the char to write

write

public void write(java.lang.String text)
Writes a string to the file

Parameters:
text - the string to write

writeLine

public void writeLine()
Writes a line break to the file.


writeLine

public void writeLine(java.lang.String text)
Writes a new line of text to the file.

Parameters:
text - the line of text to write

close

public void close()
Closes the resource.



Copyright© Kais Dukes, 2009. All Rights Reserved.