org.mule.util.counters
Interface Counter

All Known Implementing Classes:
AbstractCounter

public interface Counter

This interface is the interface implemented for all counter types. A Counter can represent a real counter or a virtual counter that will be computed using one or more other counters.

Real counters

are counters which represent real values. The user will call methods of such counters to modify the associated value of the counter.

Computed counters

are computed using one or more associated counters. Such counters represent operations computed on associated counters. Usually, these counters will never be used directly, but will only used to retrieve the computed values.

Version:
$Revision: 7976 $
Author:
Guillaume Nodet

Method Summary
 double decrement()
          Decrement the counter's value by 1.0.
 String getName()
          Accessor for the counter's name.
 CounterFactory.Type getType()
          Accessor for the counter type.
 double increment()
          Increment the counter's value by 1.0.
 double incrementBy(double value)
          Increment the counter's value by the specified amount.
 double nextValue()
          Compute and return the value of the counter.
 void setRawValue(double value)
          Set the counter's value to a new value.
 

Method Detail

getType

public CounterFactory.Type getType()
Accessor for the counter type.

Returns:
the type of the counter

getName

public String getName()
Accessor for the counter's name.

Returns:
the name of the counter

increment

public double increment()
Increment the counter's value by 1.0.

Returns:
the new value of the counter

incrementBy

public double incrementBy(double value)
Increment the counter's value by the specified amount.

Parameters:
value - the amount to increment the counter by
Returns:
the new value of the counter

decrement

public double decrement()
Decrement the counter's value by 1.0.

Returns:
the new value of the counter

setRawValue

public void setRawValue(double value)
Set the counter's value to a new value.

Parameters:
value - the new value of the counter

nextValue

public double nextValue()
Compute and return the value of the counter.

Returns:
the value of the counter


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.