|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTextOutputFile
public class TextOutputFile
Field Summary | |
---|---|
protected boolean |
closed
Set if the file has been closed. |
protected PrintWriter |
f
Streams used for the file |
protected String |
fileName
The file name. |
protected String |
lineSeparator
The line separator in files |
protected boolean |
useStandardIO
Indicator whether to write to standard output or a file. |
Constructor Summary | |
---|---|
TextOutputFile()
Contructor - TextOutputFile to write to standard output. |
|
TextOutputFile(File file)
Contructor - TextOutputFile to write to a File. |
|
TextOutputFile(File file,
boolean append)
Contructor - TextOutputFile to write or append to a File. |
|
TextOutputFile(String fileName)
Contructor - TextFile to write to file with specified name. |
|
TextOutputFile(String fileName,
boolean append)
Contructor - TextFile to write or append to file with specified name. |
Method Summary | |
---|---|
void |
close()
Close the file to further writing. |
boolean |
isStandardOut()
|
void |
print(boolean value)
Write the text representation of a boolean to the file. |
void |
print(boolean value,
int fieldSize)
Write the text representation of a boolean to the file with a specified field size. |
void |
print(byte number)
Write the text representation of an 8-bit integer (a "byte") to the file. |
void |
print(byte number,
int fieldSize)
Write the text representation of an 8-bit integer (a "byte") to the file with a specified field size. |
void |
print(char ch)
Write a character to the file. |
void |
print(char ch,
int fieldSize)
Write a character to the file with a specified field size.. |
void |
print(double number)
Write a double precision floating point number (a "double") to the file. |
void |
print(double number,
int fieldSize)
Write a double precision floating point number (a "double") to the file with a specified field size. |
void |
print(double number,
int fieldSize,
int decimalPlaces)
Write a double precision floating point number (a "double") to the file with a specified field size and a specified number of decimal places. |
void |
print(float number)
Write a floating point number (a "float") to the file. |
void |
print(float number,
int fieldSize)
Write a floating point number (a "float") to the file with a specified field size. |
void |
print(float number,
int fieldSize,
int decimalPlaces)
Write a floating point number (a "double") to the file with a specified field size and a specified number of decimal places. |
void |
print(int number)
Write the text representation of an 32-bit integer (an "int") to the file. |
void |
print(int number,
int fieldSize)
Write the text representation of an 32-bit integer (an "int") to the file with a specified field size. |
void |
print(long number)
Write the text representation of an 64-bit integer (a "long") to the file. |
void |
print(long number,
int fieldSize)
Write the text representation of an 64-bit integer (a "long") to the file with a specified field size. |
void |
print(short number)
Write the text representation of an 16-bit integer (a "short") to the file. |
void |
print(short number,
int fieldSize)
Write the text representation of an 16-bit integer (a "short") to the file with a specified field size. |
void |
print(String text)
Write a string to the file. |
void |
print(String text,
int fieldSize)
Write a string to the file with a specified field size.. |
void |
println()
Write a newline to the file. |
void |
println(boolean value)
Write the text representation of a boolean to the file followed by a newline. |
void |
println(boolean value,
int fieldSize)
Write the text representation of a boolean to the file with a specified field size followed by a newline. |
void |
println(byte number)
Write the text representation of an 8-bit integer (a "byte") to the file followed by a newline. |
void |
println(byte number,
int fieldSize)
Write the text representation of an 8-bit integer (a "byte") to the file with a specified field size followed by a newline. |
void |
println(char ch)
Write a character to the file followed by a newline. |
void |
println(char ch,
int fieldSize)
Write a character to the file with a specified field size.. |
void |
println(double number)
Write a double precision floating point number (a "double") to the file followed by a newline. |
void |
println(double number,
int fieldSize)
Write a double precision floating point number (a "double") to the file with a specified field size followed by a newline. |
void |
println(double number,
int fieldSize,
int decimalPlaces)
Write a double precision floating point number (a "double") to the file with a specified field size and a specified number of decimal places followed by a newline. |
void |
println(float number)
Write a floating point number (a "float") to the file followed by a newline. |
void |
println(float number,
int fieldSize)
Write a floating point number (a "float") to the file with a specified field size followed by a newline. |
void |
println(float number,
int fieldSize,
int decimalPlaces)
Write a floating point number (a "double") to the file with a specified field size and a specified number of decimal places followed by a newline. |
void |
println(int number)
Write the text representation of an 32-bit integer (an "int") to the file followed by a newline. |
void |
println(int number,
int fieldSize)
Write the text representation of an 32-bit integer (an "int") to the file with a specified field size followed by a newline. |
void |
println(long number)
Write the text representation of an 64-bit integer (a "long") to the file followed by a newline. |
void |
println(long number,
int fieldSize)
Write the text representation of an 64-bit integer (a "long") to the file with a specified field size followed by a newline. |
void |
println(short number)
Write the text representation of an 16-bit integer (a "short") to the file followed by a newline. |
void |
println(short number,
int fieldSize)
Write the text representation of an 16-bit integer (a "short") to the file with a specified field size followed by a newline. |
void |
println(String text)
Write a string to the file followed by a newline. |
void |
println(String text,
int fieldSize)
Write a string to the file with a specified field size followed by a newline. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean closed
protected PrintWriter f
protected String fileName
protected String lineSeparator
protected boolean useStandardIO
Constructor Detail |
---|
public TextOutputFile()
public TextOutputFile(File file)
file
- - File to be opened.public TextOutputFile(File file, boolean append)
file
- - File to be opened.append
- - True if file is to be appended to.public TextOutputFile(String fileName)
fileName
- - Name of the file to be opened.public TextOutputFile(String fileName, boolean append)
fileName
- - Name of the file to be opened.append
- - True if file is to be appended to.Method Detail |
---|
public void close()
public boolean isStandardOut()
public void print(boolean value)
value
- The boolean to be written to the file.public void print(boolean value, int fieldSize)
value
- The boolean to be written to the file.fieldSize
- The field width that the boolean is to be written in.public void print(byte number)
number
- The number to be written to the file.public void print(byte number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void print(char ch)
ch
- The character to be written to the file.public void print(char ch, int fieldSize)
ch
- The character to be written to the file.fieldSize
- The field width that the character is to be written in.public void print(double number)
number
- The number to be written to the file.public void print(double number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void print(double number, int fieldSize, int decimalPlaces)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.decimalPlaces
- The number of decimal places of the number
to be displayed.public void print(float number)
number
- The number to be written to the file.public void print(float number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void print(float number, int fieldSize, int decimalPlaces)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.decimalPlaces
- The number of decimal places of the number
to be displayed.public void print(int number)
number
- The number to be written to the file.public void print(int number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void print(long number)
number
- The number to be written to the file.public void print(long number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void print(short number)
number
- The number to be written to the file.public void print(short number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void print(String text)
text
- The string to be written to the file.public void print(String text, int fieldSize)
text
- The string to be written to the file.fieldSize
- The field width that the string is to be written in.public void println()
public void println(boolean value)
value
- The boolean to be written to the file.public void println(boolean value, int fieldSize)
value
- The boolean to be written to the file.fieldSize
- The field width that the boolean is to be written in.public void println(byte number)
number
- The number to be written to the file.public void println(byte number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void println(char ch)
ch
- The character to be written to the file.public void println(char ch, int fieldSize)
ch
- The character to be written to the file.fieldSize
- The field width that the character is to be written in.public void println(double number)
number
- The number to be written to the file.public void println(double number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void println(double number, int fieldSize, int decimalPlaces)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.decimalPlaces
- The number of decimal places of the number
to be displayed.public void println(float number)
number
- The number to be written to the file.public void println(float number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void println(float number, int fieldSize, int decimalPlaces)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.decimalPlaces
- The number of decimal places of the number
to be displayed.public void println(int number)
number
- The number to be written to the file.public void println(int number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void println(long number)
number
- The number to be written to the file.public void println(long number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void println(short number)
number
- The number to be written to the file.public void println(short number, int fieldSize)
number
- The number to be written to the file.fieldSize
- The field width that the number is to be written in.public void println(String text)
text
- The string to be written to the file.public void println(String text, int fieldSize)
text
- The string to be written to the file.fieldSize
- The field width that the string is to be written in.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |