|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEasyWriter
public class EasyWriter
Constructor Summary | |
---|---|
EasyWriter(java.lang.String fileName)
Constructs an EasyWriter associated with a new file
(or truncates an existing file). |
|
EasyWriter(java.lang.String fileName,
java.lang.String mode)
Constructs an EasyWriter that can append data to an
existing file. |
Method Summary | |
---|---|
boolean |
bad()
Checks the status of the file. |
void |
close()
Closes the file. |
void |
print(char ch)
Writes one character to the file. |
void |
print(double x)
Writes a double to the file. |
void |
print(int k)
Writes an integer to the file. |
void |
print(java.lang.Object obj)
Writes an object to the file. |
void |
print(java.lang.String s)
Writes a string to the file. |
void |
printf(java.lang.String format,
java.lang.Object... args)
A convenience method to write a formatted string to this EasyWriter using the specified format string and parameters. |
void |
println()
Writes a newline character to the file. |
void |
println(char ch)
Writes one character and newline to the file. |
void |
println(double x)
Writes a double and newline to the file. |
void |
println(int k)
Writes an integer and newline to the file. |
void |
println(java.lang.Object obj)
Writes an object and newline to the file. |
void |
println(java.lang.String s)
Writes a string and newline to the file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EasyWriter(java.lang.String fileName)
EasyWriter
associated with a new file
(or truncates an existing file).
fileName
- the name of the file to be created.public EasyWriter(java.lang.String fileName, java.lang.String mode)
EasyWriter
that can append data to an
existing file.
fileName
- the name of the file to be created.mode
- if mode
is "app" and the file exists,
then opens the file in append mode.Method Detail |
---|
public void close()
public boolean bad()
public void print(char ch)
ch
- character to be written.public void print(int k)
k
- number to be written.public void print(double x)
x
- number to be written.public void print(java.lang.String s)
s
- string to be written.public void print(java.lang.Object obj)
obj
- object to be written.public void println()
public void println(char ch)
ch
- character to be written.public void println(int k)
k
- number to be written.public void println(double x)
x
- number to be written.public void println(java.lang.String s)
s
- string to be written.public void println(java.lang.Object obj)
obj
- object to be written.public void printf(java.lang.String format, java.lang.Object... args)
EasyWriter
using the specified format string and parameters.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |