|
|||||||||||
| 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.netlisters.NetlistWriter
This extends PrintWriter to offer filtering - whenever the character '\n' is
encountered in a string to be printed, the string is tokenized and PrintWriter.println() is
called after each token. In this manner, the writer has correct system-independent
line separation, and the netlists can cache multi-line strings to print using
regular Java Strings or StringBuffers.
To have the original behavior of '\n' being the ASCII line-feed character,
instead of a system-independent line break, use one of the write(java.lang.String) methods,
or print the actual char or char[].
This class can only throw (runtime) exceptions during the constructor, if
a file cannot be opened. All other operations have suppressed messages, but
one can check if an error has occurred by calling the cumulative status flag
#getError().
| Field Summary |
| Fields inherited from class java.io.PrintWriter |
out |
| Fields inherited from class java.io.Writer |
lock |
| Constructor Summary | |
NetlistWriter(java.io.File file)
Opens a print writer that targets the given file. |
|
NetlistWriter(java.io.OutputStream output)
Opens a print writer that targets the given OutputStream. |
|
NetlistWriter(java.io.OutputStream output,
boolean autoflush)
Opens a print writer that targets the given OutputStream. |
|
NetlistWriter(java.lang.String filename)
Opens a print writer that targets the given filename. |
|
NetlistWriter(java.io.Writer output)
Opens a print writer that targets the given Writer. |
|
NetlistWriter(java.io.Writer output,
boolean autoflush)
Opens a print writer that targets the given Writer. |
|
| Method Summary | |
void |
write(java.lang.String data)
Overrides the write() method (called by all the print() methods) to have system-independent line breaks on '\n' |
| Methods inherited from class java.io.PrintWriter |
checkError, close, flush, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NetlistWriter(java.lang.String filename)
filename - the file to write to
NetlistException - if the file cannot be openedpublic NetlistWriter(java.io.File file)
file - the file to write to
NetlistException - if the file cannot be openedpublic NetlistWriter(java.io.OutputStream output)
output - the target output
public NetlistWriter(java.io.OutputStream output,
boolean autoflush)
output - the target outputautoflush - whether to autoflushpublic NetlistWriter(java.io.Writer output)
output - the target output
public NetlistWriter(java.io.Writer output,
boolean autoflush)
output - the target outputautoflush - whether to autoflush| Method Detail |
public void write(java.lang.String data)
data - the String to print to the file
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||