|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--phonebill.util.Out
This class provides output capabilities. The underlying mechanism uses PrintWriters with autoflushing.
Field Summary | |
protected static java.text.NumberFormat |
currencyFormatter
The currency Formatter |
protected static java.text.DateFormat |
dateFormatter
The date Formatter |
protected static java.io.PrintWriter |
debug
The writer of debugging messages. |
protected static int |
debugLevel
The level of debugging output. |
static java.lang.String |
indent
The standard indentation string. |
protected static boolean |
mustCloseDebug
Indicates whether or not we are supposed to close the debugging writer. |
protected static boolean |
mustCloseOutput
Indicates whether or not we are supposed to close the output writer. |
static java.lang.String |
newLineChar
The system dependent newline character. |
protected static java.text.NumberFormat |
numberFormatter
The number Formatter |
protected static java.io.PrintWriter |
output
The writer of output messages. |
Constructor Summary | |
private |
Out()
Constructs a new Out object. |
Method Summary | |
static void |
cleanup()
Clean up loose ends. |
static void |
debug(int level,
java.lang.String message)
Writes a debugging message on a whole line if the current debugLevel permits it. |
static void |
debug(java.lang.Throwable thrown)
Writes the stack trace for thrown as a debugging message ignoring the current debugLevel. |
static java.text.NumberFormat |
getCurrencyFormat()
Return a general purpose number formatter. |
static java.text.DateFormat |
getDateFormat()
Return a general purpose date formatter. |
static int |
getDebugLevel()
Return the current debugging level. |
static java.text.NumberFormat |
getNumberFormat()
Return a general purpose currency formatter. |
static void |
print(java.lang.String message)
Writes an output message without linebreak. |
static void |
println()
Writes a linebreak on the current output writer. |
static void |
println(java.lang.String message)
Writes an output message on a whole line. |
static boolean |
setDebug(java.io.OutputStream out)
Set the writer of debugging messages. |
static boolean |
setDebug(java.io.OutputStream out,
boolean mustClose)
Set the writer of debugging messages. |
static void |
setDebugLevel(int newLevel)
Set the upper limit on debugging messages. |
static boolean |
setPrint(java.io.OutputStream out)
Set the writer of output messages. |
static boolean |
setPrint(java.io.OutputStream out,
boolean mustClose)
Set the writer of output messages. |
static boolean |
willCloseDebug()
Return whether the current debugging writer will be closed automatically. |
static boolean |
willCloseOutput()
Return whether the current output writer will be closed automatically. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final java.lang.String newLineChar
public static final java.lang.String indent
protected static final java.text.DateFormat dateFormatter
protected static final java.text.NumberFormat numberFormatter
protected static final java.text.NumberFormat currencyFormatter
protected static int debugLevel
protected static java.io.PrintWriter debug
protected static boolean mustCloseDebug
protected static java.io.PrintWriter output
protected static boolean mustCloseOutput
Constructor Detail |
private Out() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if it is usedMethod Detail |
public static void debug(int level, java.lang.String message)
level
- The level of this debugging message. High numbers are more detailed.message
- The message to write.public static void debug(java.lang.Throwable thrown)
thrown
- The Throwable to write.public static void print(java.lang.String message)
message
- The message to write.public static void println(java.lang.String message)
message
- The message to write.public static void println()
public static int getDebugLevel()
public static boolean willCloseDebug()
public static boolean willCloseOutput()
public static java.text.DateFormat getDateFormat()
DateFormat.getInstance()
public static java.text.NumberFormat getCurrencyFormat()
NumberFormat.getInstance()
public static java.text.NumberFormat getNumberFormat()
NumberFormat.getCurrencyInstance()
public static void setDebugLevel(int newLevel)
newLevel
- The limit to use. A high number means more messages.public static boolean setDebug(java.io.OutputStream out)
out
- The new OutputStream to use for debugging messages.public static boolean setDebug(java.io.OutputStream out, boolean mustClose)
out
- The new OutputStream to use for debugging messages.mustClose
- if true, out will be closed automatically on replacement.public static boolean setPrint(java.io.OutputStream out)
out
- The new OutputStream to use for output messages.public static boolean setPrint(java.io.OutputStream out, boolean mustClose)
out
- The new OutputStream to use for output messages.mustClose
- if true, out will be closed automatically on replacement.public static void cleanup()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |