Coverage Report - org.mule.util.counters.impl.Number
 
Classes in this File Line Coverage Branch Coverage Complexity
Number
100%
16/16
N/A
1
 
 1  
 /*
 2  
  * $Id: Number.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 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 CPAL v1.0
 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.CounterFactory.Type;
 14  
 
 15  
 public class Number extends AbstractCounter
 16  
 {
 17  
 
 18  16
     private double value = 0.0;
 19  
 
 20  
     public Number(String name)
 21  
     {
 22  16
         super(name, Type.NUMBER);
 23  16
     }
 24  
 
 25  
     public synchronized double increment()
 26  
     {
 27  2
         this.value++;
 28  2
         propagate();
 29  2
         return this.value;
 30  
     }
 31  
 
 32  
     public synchronized double incrementBy(double value)
 33  
     {
 34  2
         this.value += value;
 35  2
         propagate();
 36  2
         return this.value;
 37  
     }
 38  
 
 39  
     public synchronized double decrement()
 40  
     {
 41  2
         this.value--;
 42  2
         propagate();
 43  2
         return this.value;
 44  
     }
 45  
 
 46  
     public synchronized void setRawValue(double value)
 47  
     {
 48  44
         this.value = value;
 49  44
         propagate();
 50  44
     }
 51  
 
 52  
     public synchronized double nextValue()
 53  
     {
 54  70
         return this.value;
 55  
     }
 56  
 
 57  
 }