KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > util > NullDebug


1 package org.sapia.ubik.util;
2
3 import java.io.IOException JavaDoc;
4 import java.io.OutputStream JavaDoc;
5 import java.io.PrintStream JavaDoc;
6
7 /**
8  * A <code>Debug</code> implementation that outputs nothing.
9  *
10  * @author Yanick Duchesne
11  *
12  * <dl>
13  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2005 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
14  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
15  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
16  * </dl>
17  */

18 public class NullDebug implements Debug{
19   
20   public boolean on() {
21     return false;
22   }
23   public void on(boolean on) {
24   }
25   public PrintStream JavaDoc out() {
26     return new PrintStream JavaDoc(new NullOutputStream());
27   }
28   public void out(Class JavaDoc caller, String JavaDoc msg, Throwable JavaDoc err) {
29   }
30   public void out(Class JavaDoc caller, String JavaDoc msg) {
31   }
32   final class NullOutputStream extends OutputStream JavaDoc{
33     public void write(int b) throws IOException JavaDoc {
34     }
35   }
36 }
37
Popular Tags