STUB: Should include code to emit a new line before a header which is not the first thing on the line.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final PrintWriterGetHeader | |
| private final String |
| Access | Constructor and Description |
|---|---|
| pack-priv | BasicHeaderPrintWriter(OutputStream
Where to write to. writeTo, PrintWriterGetHeader Object to get headers for output lines. headerGetter, boolean If true, canClose, String complete will also close writeToName of writeTo, e.g. a file name streamName)the constructor sets up the HeaderPrintWriter. |
| pack-priv | BasicHeaderPrintWriter(Writer
Where to write to. writeTo, PrintWriterGetHeader Object to get headers for output lines. headerGetter, boolean If true, canClose, String complete will also close writeToName of writeTo, e.g. a file name writerName)the constructor sets up the HeaderPrintWriter. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public PrintWriterGetHeader | getHeader()
Implements org. Return the header for the stream. |
| public String | getName()
Implements org. Gets the name of the wrapped writer or stream |
| public PrintWriter | getPrintWriter()
Implements org. Gets a PrintWriter object for writing to this HeaderPrintWriter. |
| public synchronized void | printlnWithHeader(String
Message to print message)Implements org. Puts out some setup info for the current write and the write(s) that will be put out next. |
| canClose | back to summary |
|---|---|
| private final boolean canClose | |
| headerGetter | back to summary |
|---|---|
| private final PrintWriterGetHeader headerGetter | |
| name | back to summary |
|---|---|
| private final String name | |
| BasicHeaderPrintWriter | back to summary |
|---|---|
| pack-priv BasicHeaderPrintWriter(OutputStream writeTo, PrintWriterGetHeader headerGetter, boolean canClose, String streamName) the constructor sets up the HeaderPrintWriter.
| |
| BasicHeaderPrintWriter | back to summary |
|---|---|
| pack-priv BasicHeaderPrintWriter(Writer writeTo, PrintWriterGetHeader headerGetter, boolean canClose, String writerName) the constructor sets up the HeaderPrintWriter.
| |
| complete | back to summary |
|---|---|
| pack-priv void complete() Flushes stream, and optionally also closes it if constructed with canClose equal to true. | |
| getHeader | back to summary |
|---|---|
| public PrintWriterGetHeader getHeader() Implements org. Doc from org. Return the header for the stream.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Doc from org. Gets the name of the wrapped writer or stream
| |
| getPrintWriter | back to summary |
|---|---|
| public PrintWriter getPrintWriter() Implements org. Doc from org. Gets a PrintWriter object for writing to this HeaderPrintWriter. Users may use the HeaderPrintWriter to access methods not included in this interface or to invoke methods or constructors which require a PrintWriter. Interleaving calls to a printWriter and its associated HeaderPrintWriter is not supported.
| |
| printlnWithHeader | back to summary |
|---|---|
| public synchronized void printlnWithHeader(String message) Implements org. Doc from org. Puts out some setup info for the current write and the write(s) that will be put out next. It ends with a \n\r. All other writes to the stream use the PrintStream interface.
| |