1 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 20 public abstract class AggregateCounter extends AbstractCounter 21 { 22 23 private Counter base; 24 25 public AggregateCounter(String 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 (); 35 } 36 37 public double incrementBy(double value) 38 { 39 throw new UnsupportedOperationException (); 40 } 41 42 public double decrement() 43 { 44 throw new UnsupportedOperationException (); 45 } 46 47 public void setRawValue(double value) 48 { 49 throw new UnsupportedOperationException (); 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 |