KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > management > browser > ui > statistics > StatisticCustomizerFactory


1 /*
2  * EJTools, the Enterprise Java Tools
3  *
4  * Distributable under LGPL license.
5  * See terms of license at www.gnu.org.
6  */

7 package org.ejtools.management.browser.ui.statistics;
8
9 import javax.management.j2ee.statistics.BoundaryStatistic JavaDoc;
10 import javax.management.j2ee.statistics.BoundedRangeStatistic JavaDoc;
11 import javax.management.j2ee.statistics.CountStatistic JavaDoc;
12 import javax.management.j2ee.statistics.RangeStatistic JavaDoc;
13 import javax.management.j2ee.statistics.Statistic JavaDoc;
14 import javax.management.j2ee.statistics.TimeStatistic JavaDoc;
15
16 /**
17  * @author letiemble
18  * @version $Revision: 1.2 $
19  */

20 public abstract class StatisticCustomizerFactory
21 {
22    /**
23     * Description of the Method
24     *
25     * @param statistic Description of the Parameter
26     * @return Description of the Return Value
27     */

28    public static StatisticCustomizer create(Statistic JavaDoc statistic)
29    {
30       if (statistic instanceof CountStatistic JavaDoc)
31       {
32          return new CountStatisticCustomizer(statistic);
33       }
34       if (statistic instanceof TimeStatistic JavaDoc)
35       {
36          return new TimeStatisticCustomizer(statistic);
37       }
38       if (statistic instanceof BoundedRangeStatistic JavaDoc)
39       {
40          return new BoundedRangeStatisticCustomizer(statistic);
41       }
42       if (statistic instanceof BoundaryStatistic JavaDoc)
43       {
44          return new BoundaryStatisticCustomizer(statistic);
45       }
46       if (statistic instanceof RangeStatistic JavaDoc)
47       {
48          return new RangeStatisticCustomizer(statistic);
49       }
50
51       return null;
52    }
53 }
54
55
Popular Tags