public class ASCIIOutputFile
extends java.lang.Object
Constructor and Description |
---|
ASCIIOutputFile()
Constructs an ASCIIOutputFile, prompting the user via Dialog Box for a file to write to.
|
ASCIIOutputFile(java.io.File file)
Constructs an ASCIIOutputFile using the file provided.
|
ASCIIOutputFile(java.lang.String filename)
Constructs an ASCIIOutputFile and tries to open a file with the path provided in the String.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the file.
|
java.io.File |
getFile()
Returns the file being used
|
void |
newLine()
Writes a newline character to the file.
|
boolean |
successful()
Indicates whether or not the previous operation
was successful.
|
void |
writeBoolean(boolean b)
Writes a boolean to the file
|
void |
writeByte(byte b)
Writes a byte to the file
|
void |
writeC(char c)
Writes a char to the file without any field seperators.
|
void |
writeChar(char c)
Writes a char to the file
|
void |
writeDouble(double d)
Writes a double to the file
|
void |
writeEOL()
Deprecated.
Use newLine() instead.
|
void |
writeFloat(float f)
Writes a float to the file
|
void |
writeInt(int i)
Writes an int to the file
|
void |
writeLine(java.lang.String s)
Writes a String to the file with a newline character at the end of the String.
|
void |
writeLong(long l)
Writes a long to the file
|
void |
writeShort(short s)
Writes a short to the file
|
void |
writeString(java.lang.String s)
Writes a String to the file
|
public ASCIIOutputFile()
public ASCIIOutputFile(java.lang.String filename)
filename
- the name of the file to write topublic ASCIIOutputFile(java.io.File file)
file
- the file to write topublic java.io.File getFile()
public boolean successful()
public void close()
public void writeByte(byte b)
b
- a byte to be written as a field to the filepublic void writeChar(char c)
c
- char to be written as a field to the filepublic void writeC(char c)
c
- a char to be written as a field to the filepublic void writeDouble(double d)
d
- a double to be written as a field to the filepublic void writeFloat(float f)
f
- a float to be written as a field to the filepublic void writeInt(int i)
i
- an int to be written as a field to the filepublic void writeShort(short s)
s
- short to be written as a field to the filepublic void writeLong(long l)
l
- a long to be written as a field to the filepublic void writeString(java.lang.String s)
s
- a String to be written as a field to the filepublic void writeBoolean(boolean b)
b
- a boolean to be written as a field to the filepublic void writeLine(java.lang.String s)
s
- a String to be written to the filepublic void writeEOL()
public void newLine()