|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.output.OWriter | +--xbn.output.OWWrapper
The base class for an OWriter that can wrap around objects like java.io.OutputStreams and java.io.Writer. See OutputStream and Writer.
Source code: OWWrapper.java.
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
OWWrapper()
Create a OWWrapper with default settings. |
|
OWWrapper(boolean b_autoFlush)
Create a OWWrapper. |
|
OWWrapper(boolean b_autoFlush,
boolean b_suppressFinalizeIOX)
Create a OWWrapper. |
|
OWWrapper(boolean b_autoFlush,
boolean b_closeInFinalize,
boolean b_suppressFinalizeIOX)
Create a OWWrapper. |
Method Summary | |
boolean |
doAutoFlush()
Should the [writer/stream] be automatically flushed, after each output? |
boolean |
doFlushCloseInFinalize()
Should the [writer/stream] be flushed and closed in finalize?. |
boolean |
doSuppressFinalizeIOX()
If an IOException should occur in finalize, should it be suppressed? |
protected void |
finalize()
Flush, close and then null the [writer/stream]. |
abstract void |
flush()
Manually flush the [writer/stream] by calling flush(). |
abstract void |
newln()
Write a newline only, to the [writer/stream] via println(). |
void |
setAutoFlush(boolean b_autoFlush)
Define if flush should be called at the end of every write function. |
void |
setFlushCloseInFinalize(boolean b_closeInFinalize)
When this class is finalized, should the [writer/stream] be flushed and closed?. |
void |
setSuppressFinalizeIOX(boolean b_suppressFinalizeIOX)
Define if an IOException should be suppressed, should one occur in finalize. |
abstract void |
write(String s_message)
Write a line of output to the [writer/stream] via println(java.lang.String). |
abstract void |
writeNoln(String s_message)
Write a line of output to the [writer/stream] via print(java.lang.String). |
Methods inherited from class xbn.output.OWriter |
isActive |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OWWrapper()
Create a OWWrapper with default settings.
Equal to OWWrapper(false, false, false)
public OWWrapper(boolean b_autoFlush)
Create a OWWrapper.
Equal to OWWrapper(b_autoFlush, true)
public OWWrapper(boolean b_autoFlush, boolean b_suppressFinalizeIOX)
Create a OWWrapper.
Equal to OWWrapper(b_autoFlush, true, b_suppressFinalizeIOX)
public OWWrapper(boolean b_autoFlush, boolean b_closeInFinalize, boolean b_suppressFinalizeIOX)
Create a OWWrapper.
b_autoFlush
- Should the stream be flushed after every output? Passed directly to setAutoFlush.b_closeInFinalize
- Should the [writer/stream] be closed in finalize? Passed directly to setFlushCloseInFinalize.b_suppressFinalizeIOX
- Should IOExceptions in finalize be suppressed? Passed directly to setSuppressFinalizeIOX.Method Detail |
public final void setFlushCloseInFinalize(boolean b_closeInFinalize)
When this class is finalized, should the [writer/stream] be flushed and closed?. See doFlushCloseInFinalize.
b_closeInFinalize
- If true, the [writer/stream] will be closed during finalize. If false, If it will not be closed.public boolean doFlushCloseInFinalize()
Should the [writer/stream] be flushed and closed in finalize?. See setFlushCloseInFinalize.
Note that this setting does not affect flushing. No matter what, the stream is flushed, before (potentially) being closed.
public final void setAutoFlush(boolean b_autoFlush)
Define if flush should be called at the end of every write function.
Get with doSuppressFinalizeIOX
b_suppressFinalizeIOX
- If true, do suppress any IOException that should occur in finalize. If false, don't.public final void setSuppressFinalizeIOX(boolean b_suppressFinalizeIOX)
Define if an IOException should be suppressed, should one occur in finalize.
Get with doSuppressFinalizeIOX
b_suppressFinalizeIOX
- If true, do suppress IOExceptions that occur in finalize. If false, don't.public boolean doAutoFlush()
Should the [writer/stream] be automatically flushed, after each output?
Set with setAutoFlush
Regardless of this setting, flush is always called in finalize.
public boolean doSuppressFinalizeIOX()
If an IOException should occur in finalize, should it be suppressed?
Set with setSuppressFinalizeIOX
public abstract void write(String s_message)
Write a line of output to the [writer/stream] via println(java.lang.String).
After output is written, if doAutoFlush equals true, call flush.
write
in class OWriter
s_message
- The message to output.AssertException
- If an IOException is thrown for any reason.public abstract void writeNoln(String s_message)
Write a line of output to the [writer/stream] via print(java.lang.String).
After output is written, if doAutoFlush equals true, call flush.
writeNoln
in class OWriter
s_message
- The message to output.AssertException
- If an IOException is thrown for any reason.public abstract void newln()
Write a newline only, to the [writer/stream] via println().
After output is written, if doAutoFlush equals true, call flush.
newln
in class OWriter
s_message
- The message to output.AssertException
- If an IOException is thrown for any reason.public abstract void flush()
Manually flush the [writer/stream] by calling flush().
protected void finalize() throws Throwable
Flush, close and then null the [writer/stream].
flush and close (only if doFlushCloseInFinalize equals true).
Note: The OWWrapper version of this function must be overridden by you--in order to actually flush and close the [writer/stream], and you must call this function (via super.finalize()) in your implementation.
finalize
in class Object
AssertException
- If doSuppressFinalizeIOX is true and an IOException is thrown for any reason. Note that java.lang.Object.finalize is definitely called, even in the event of an IOException.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/xbnjava