net.java.dev.moskito.core.stats
Interface ValueHolder

All Known Implementing Classes:
AbstractValueHolder, IntValueHolder, LongValueHolder

public interface ValueHolder

This interface desclares any type-specific holder implementation and declares the interface to support some basic mathematical operations needed for statistical aggregations.

Author:
dvayanu

Method Summary
 void decrease()
          This method shall decrement the value by one.
 void decreaseByDouble(double aValue)
          This method shall decrement the current value by the given amount.
 void decreaseByInt(int aValue)
          This method shall decrement the current value by the given amount.
 void decreaseByLong(long aValue)
          This method shall decrement the current value by the given amount.
 double getCurrentValueAsDouble()
          This method shall return the current value as double for internal use only.
 int getCurrentValueAsInt()
          This method shall return the current value as int for internal use only.
 long getCurrentValueAsLong()
          This method shall return the current value as long for internal use only.
 double getValueAsDouble()
          This method shall return the current value as double.
 int getValueAsInt()
          This method shall return the current value as int.
 long getValueAsLong()
          This method shall return the current value as long.
 void increase()
          This method shall increment the value by one.
 void increaseByDouble(double aValue)
          This method shall increment the current value by the given amount.
 void increaseByInt(int aValue)
          This method shall increment the current value by the given amount.
 void increaseByLong(long aValue)
          This method shall increment the current value by the given amount.
 void reset()
          This method shall reset the ValueHolder.
 void setDefaultValueAsDouble(double aValue)
          This method shall set a new default value.
 void setDefaultValueAsInt(int aValue)
          This method shall set a new default value.
 void setDefaultValueAsLong(long aValue)
          This method shall set a new default value.
 void setValueAsDouble(double aValue)
          This method shall assign the given value to the current value.
 void setValueAsInt(int aValue)
          This method shall assign the given value to the current value.
 void setValueAsLong(long aValue)
          This method shall assign the given value to the current value.
 

Method Detail

reset

void reset()
This method shall reset the ValueHolder. After calling reset() it must have the same state as directly after creation.


increase

void increase()
This method shall increment the value by one.


decrease

void decrease()
This method shall decrement the value by one.


getValueAsInt

int getValueAsInt()
This method shall return the current value as int.

Returns:
the current value

getValueAsLong

long getValueAsLong()
This method shall return the current value as long.

Returns:
the current value

getValueAsDouble

double getValueAsDouble()
This method shall return the current value as double.

Returns:
the current value

getCurrentValueAsInt

int getCurrentValueAsInt()
This method shall return the current value as int for internal use only.

Returns:
the current value

getCurrentValueAsLong

long getCurrentValueAsLong()
This method shall return the current value as long for internal use only.

Returns:
the current value

getCurrentValueAsDouble

double getCurrentValueAsDouble()
This method shall return the current value as double for internal use only.

Returns:
the current value

setValueAsInt

void setValueAsInt(int aValue)
This method shall assign the given value to the current value.

Parameters:
aValue - the new value

setValueAsLong

void setValueAsLong(long aValue)
This method shall assign the given value to the current value.

Parameters:
aValue - the new value

setValueAsDouble

void setValueAsDouble(double aValue)
This method shall assign the given value to the current value.

Parameters:
aValue - the new value

increaseByInt

void increaseByInt(int aValue)
This method shall increment the current value by the given amount.

Parameters:
aValue - the amount

increaseByLong

void increaseByLong(long aValue)
This method shall increment the current value by the given amount.

Parameters:
aValue - the amount

increaseByDouble

void increaseByDouble(double aValue)
This method shall increment the current value by the given amount.

Parameters:
aValue - the amount

decreaseByInt

void decreaseByInt(int aValue)
This method shall decrement the current value by the given amount.

Parameters:
aValue - the amount

decreaseByLong

void decreaseByLong(long aValue)
This method shall decrement the current value by the given amount.

Parameters:
aValue - the amount

decreaseByDouble

void decreaseByDouble(double aValue)
This method shall decrement the current value by the given amount.

Parameters:
aValue - the amount

setDefaultValueAsInt

void setDefaultValueAsInt(int aValue)
This method shall set a new default value. The default value shall be set as current value if the reset method will be called.

Parameters:
aValue - the new default value

setDefaultValueAsLong

void setDefaultValueAsLong(long aValue)
This method shall set a new default value. The default value shall be set as current value if the reset method will be called.

Parameters:
aValue - the new default value

setDefaultValueAsDouble

void setDefaultValueAsDouble(double aValue)
This method shall set a new default value. The default value shall be set as current value if the reset method will be called.

Parameters:
aValue - the new default value


Copyright © 2006 MoSKito Project Team. All Rights Reserved.
MoSKito, the open source java monitoring framework