KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > management > stats > printers > SimplePrinter


1 /*
2  * $Id: SimplePrinter.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.management.stats.printers;
12
13 import java.io.OutputStream JavaDoc;
14 import java.io.Writer JavaDoc;
15 import java.util.Collection JavaDoc;
16
17 /**
18  * <code>SimplePrinter</code> Default stats printer
19  *
20  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
21  * @version $Revision: 3798 $
22  */

23 public class SimplePrinter extends AbstractTablePrinter
24 {
25     public SimplePrinter(Writer JavaDoc out)
26     {
27         super(out);
28     }
29
30     public SimplePrinter(OutputStream JavaDoc out)
31     {
32         super(out);
33     }
34
35     public void print(Collection JavaDoc stats)
36     {
37         String JavaDoc[][] table = getTable(stats);
38         for (int i = 1; i < table.length; i++)
39         {
40             println();
41             println("---- Component Statistics ----");
42             for (int j = 0; j < table[0].length; j++)
43             {
44                 println(table[0][j] + ": " + table[i][j]);
45             }
46             println("---- End Component Statistics ----");
47         }
48     }
49 }
50
Popular Tags