KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > util > stream > Printable


1 /***************************************
2  * *
3  * JBoss: The OpenSource J2EE WebOS *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  ***************************************/

9
10 package org.jboss.util.stream;
11
12 import java.io.PrintWriter JavaDoc;
13 import java.io.PrintStream JavaDoc;
14
15 /**
16  * A simple interface to allow an object to print itself to a
17  * <code>PrintWriter</code> or <code>PrintStream</code>.
18  *
19  * @version <tt>$Revision: 1.1 $</tt>
20  * @author <a HREF="mailto:jason@planet57.com">Jason Dillon</a>
21  */

22 public interface Printable
23 {
24    /**
25     * Print to a PrintWriter.
26     *
27     * @param writer PrintWriter to print to.
28     */

29    void print(PrintWriter JavaDoc writer);
30
31    /**
32     * Print to a PrintWriter.
33     *
34     * @param writer PrintWriter to print to.
35     * @param prefix Prefix to append to each line in the stream.
36     */

37    void print(PrintWriter JavaDoc writer, String JavaDoc prefix);
38
39    /**
40     * Print to a PrintStream.
41     *
42     * @param stream PrintStream to print to.
43     */

44    void print(PrintStream JavaDoc stream);
45
46    /**
47     * Print to a PrintStream.
48     *
49     * @param stream PrintStream to print to.
50     * @param prefix Prefix to append to each line in the stream.
51     */

52    void print(PrintStream JavaDoc stream, String JavaDoc prefix);
53 }
54
Popular Tags