
/**
 * A class for writing text to a file. The class is a superset of
 * PrintWriter adding formatted output and integrated error checking.
 *
 * Full documentation for the classes in the hsa package available at:
 *     http://www.holtsoft.com/java/hsa_package.html
 *
 * @author Nathan Stevens
 * @version 0.1, June 9, 2003
 */

import java.io.*;

public class TextOutputFile {
	PrintWriter out;
	public TextOutputFile(File file) {
		try {
			out = new PrintWriter(new BufferedWriter(new FileWriter(file.getAbsolutePath())));
		}
		catch(IOException ioe) {
			System.err.println("Error writing string to file...");
		}
	}
	
	// Method to print a string to a file
	public void print(String string) {
		out.print(string);
	}
	
	// Method to close the writer
	public void close() {
		out.flush();
		out.close();
	}
} // --End of TextOutputFile
