KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > util > counters > impl > AggregateCounter


1 /*
2  * $Id: AggregateCounter.java 3167 2006-09-22 15:47:04Z holger $
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.util.counters.impl;
12
13 import org.mule.util.counters.Counter;
14 import org.mule.util.counters.CounterFactory.Type;
15
16 /**
17  * @author <a HREF="mailto:gnt@codehaus.org">Guillaume Nodet</a>
18  * @version $Revision: 3167 $
19  */

20 public abstract class AggregateCounter extends AbstractCounter
21 {
22
23     private Counter base;
24
25     public AggregateCounter(String JavaDoc name, Type type, AbstractCounter base)
26     {
27         super(name, type);
28         this.base = base;
29         base.addAggregate(this);
30     }
31
32     public double increment()
33     {
34         throw new UnsupportedOperationException JavaDoc();
35     }
36
37     public double incrementBy(double value)
38     {
39         throw new UnsupportedOperationException JavaDoc();
40     }
41
42     public double decrement()
43     {
44         throw new UnsupportedOperationException JavaDoc();
45     }
46
47     public void setRawValue(double value)
48     {
49         throw new UnsupportedOperationException JavaDoc();
50     }
51
52     public void compute()
53     {
54         doCompute();
55         propagate();
56     }
57
58     public Counter getBase()
59     {
60         return this.base;
61     }
62
63     public abstract double nextValue();
64
65     public abstract void doCompute();
66
67 }
68
Popular Tags