|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
java.io.PrintWriter
byucc.jhdl.JHDLPrintWriter
This class extends PrintWriter
. It is designed for use as an error message
handling mechanism. The class JHDLOutput
instantiates this class, and it
also determines what the OutputStream
will be.
Field Summary |
Fields inherited from class java.io.PrintWriter |
out |
Fields inherited from class java.io.Writer |
lock |
Constructor Summary | |
JHDLPrintWriter()
Creates a disabled JHDLPrintWriter . |
|
JHDLPrintWriter(java.io.File file)
|
|
JHDLPrintWriter(JHDLPrintWriter pw)
|
|
JHDLPrintWriter(JHDLPrintWriter pw,
boolean autoFlush)
|
|
JHDLPrintWriter(java.io.OutputStream outputStream)
Initializes the PrintWriter 's OutputStream to outputStream . |
|
JHDLPrintWriter(java.io.OutputStream outputStream,
boolean autoFlush)
Creates a PrintWriter to the given stream |
|
JHDLPrintWriter(java.lang.String filename)
Creates a JHDLPrintWriter that targets a particular filename. |
|
JHDLPrintWriter(java.io.Writer outputWriter)
Initializes the PrintWriter 's OutputStream to outputStream . |
|
JHDLPrintWriter(java.io.Writer outputWriter,
boolean autoFlush)
Creates a PrintWriter to the given stream |
Method Summary | |
boolean |
disable()
Disables this JHDLPrintWriter object |
boolean |
enable()
Enables this JHDLPrintWriter object |
void |
finalize()
Finalizer. |
static java.io.BufferedWriter |
getBufferedWriter(java.lang.String fileName)
|
boolean |
getEnabled()
Returns the enabled state of this JHDLPrintWriter |
java.io.Writer |
getWriter()
|
boolean |
isEnabled()
Returns the value of isEnabled . |
void |
print(boolean arg)
Override of print() method to handle the case when the instance is not enabled. |
void |
print(char arg)
Override of print() method to handle the case when the instance is not enabled. |
void |
print(char[] s)
The lone print() that does not call write(String) in the inherited version. |
void |
println()
Override of println() method to handle the case when the instance is not enabled. |
void |
println(boolean arg)
Override of println() method to handle the case when the instance is not enabled. |
void |
println(char arg)
Override of println() method to handle the case when the instance is not enabled. |
void |
println(char[] arg)
Override of println() method to handle the case when the instance is not enabled. |
void |
println(double arg)
Override of println() method to handle the case when the instance is not enabled. |
void |
println(float arg)
Override of println() method to handle the case when the instance is not enabled. |
void |
println(int arg)
Override of println() method to handle the case when the instance is not enabled. |
void |
println(long arg)
Override of println() method to handle the case when the instance is not enabled. |
void |
println(java.lang.Object arg)
Override of println() method to handle the case when the instance is not enabled. |
void |
println(java.lang.String arg)
Provides correct prefix and printing behavior, based on whether this instance is enabled. |
boolean |
setEnabled(boolean setTo)
Sets the enabled status of this JHDLPrintWriter object. |
java.lang.String |
toString()
Returns a string describing where this print writer is currently directed. |
void |
write(java.lang.String str)
In order to make the passed text compatible with all operating systems (theoretically), this replaces all '\n' characters with a call to println() . |
Methods inherited from class java.io.PrintWriter |
checkError, close, flush, print, print, print, print, print, print, setError, write, write, write, write |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JHDLPrintWriter(JHDLPrintWriter pw, boolean autoFlush)
public JHDLPrintWriter(JHDLPrintWriter pw)
public JHDLPrintWriter(java.io.OutputStream outputStream, boolean autoFlush)
outputStream
- The target output stream (may be null, in which case this is disabled)autoFlush
- sets the autoFlush flag on the PrintWriter objectpublic JHDLPrintWriter(java.io.OutputStream outputStream)
PrintWriter
's OutputStream
to outputStream
.
outputStream
- The target OutputStream
.public JHDLPrintWriter(java.io.Writer outputWriter, boolean autoFlush)
autoFlush
- sets the autoFlush flag on the PrintWriter objectpublic JHDLPrintWriter(java.io.Writer outputWriter)
PrintWriter
's OutputStream
to outputStream
.
public JHDLPrintWriter()
JHDLPrintWriter
.
public JHDLPrintWriter(java.lang.String filename) throws java.io.IOException
JHDLPrintWriter
that targets a particular filename.
If the filename is null
, then output is disabled.
filename
- the file to direct output to (may be null)
java.io.IOException
- if there is a problem creating the streampublic JHDLPrintWriter(java.io.File file) throws java.io.IOException
Method Detail |
public static java.io.BufferedWriter getBufferedWriter(java.lang.String fileName)
public boolean isEnabled()
isEnabled
. If false, then the print(char[])
methods
of this class do nothing.
true
if this printWriter is directed to some output stream.public void print(char[] s)
write(String)
in the inherited version.
s
- the array of chars to printwrite(String)
public java.io.Writer getWriter()
public void write(java.lang.String str)
'\n'
characters with a call to println()
.
According to the source code of PrintWriter
, all of the print() methods
not explicitly overloaded in this class eventually call this method.
If isEnabled()
returns false
, then this method does nothing.
str
- the string to printpublic void print(boolean arg)
arg
- the data to printpublic void print(char arg)
arg
- the data to printpublic void println(java.lang.String arg)
arg
- the string to printpublic void println(boolean arg)
arg
- the data to printpublic void println(char arg)
arg
- the data to printpublic void println(char[] arg)
arg
- the data to printpublic void println(double arg)
arg
- the data to printpublic void println(float arg)
arg
- the data to printpublic void println(int arg)
arg
- the data to printpublic void println(long arg)
arg
- the data to printpublic void println(java.lang.Object arg)
arg
- the data to printpublic void println()
public java.lang.String toString()
public boolean disable()
public boolean enable()
public boolean setEnabled(boolean setTo)
setTo
- the new boolean setting of isEnabled for this objectpublic boolean getEnabled()
public void finalize()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |