DebugOutImplpublic class DebugOutImpl extends Object implements DebugOut
Fields Summary |
---|
private final String | mID | private boolean | mDebug | private DebugSink | mSink |
Constructors Summary |
---|
public DebugOutImpl(String id, boolean debug, DebugSink sink)
mID = id;
mDebug = debug;
mSink = sink == null ? new DebugSinkImpl( System.out ) : sink ;
| public DebugOutImpl(String id, boolean debug)
this( id, debug, null );
|
Methods Summary |
---|
public void | debug(java.lang.Object args)
if ( getDebug() )
{
mSink.println( toString( args ) );
}
| public void | debugMethod(java.lang.String methodName, java.lang.Object args)
if ( getDebug() )
{
debug( methodString( methodName, args ) );
}
| public void | debugMethod(java.lang.String msg, java.lang.String methodName, java.lang.Object args)
if ( getDebug() )
{
debug( methodString( methodName, args ) + ": " + msg );
}
| public boolean | getDebug()
return mDebug;
| public java.lang.String | getID()
return mID;
| public static java.lang.String | methodString(java.lang.String name, java.lang.Object args)
String result = null;
if ( args == null || args.length == 0 )
{
result = name + "()";
}
else
{
final String argsString = StringUtil.toString( ", ", args );
result = StringUtil.toString( "", name, "(", argsString, ")" );
}
return result;
| public void | print(java.lang.Object o)
mSink.print( "" + o );
| public void | println(java.lang.Object o)
mSink.println( "" + o );
| public void | setDebug(boolean debug)
mDebug = debug;
| public java.lang.String | toString(java.lang.Object args)
return StringUtil.toString( ", ", args );
|
|