org.mule.util.counters
Interface Counter

All Superinterfaces:
NamedObject
All Known Implementing Classes:
AbstractCounter, AggregateCounter, Average, Delta, InstantRate, Max, Min, Number, Operator, RatePerUnit, Sum, TimeAverage

public interface Counter
extends NamedObject

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.


Method Summary
 double decrement()
          Decrement the counter's value by 1.0.
 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.
 
Methods inherited from interface org.mule.api.NamedObject
getName
 

Method Detail

getType

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

Returns:
the type of the counter

increment

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

Returns:
the new value of the counter

incrementBy

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

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

Returns:
the new value of the counter

setRawValue

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

Parameters:
value - the new value of the counter

nextValue

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

Returns:
the value of the counter


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.