Main Page | Modules | Class Hierarchy | Class List | Directories | Class Members | Related Pages | Examples

HistogramBin< T > Class Template Reference

#include <Histogram.h>

Inheritance diagram for HistogramBin< T >:

InfiniteHistogramBin< T > List of all members.

Public Member Functions

 HistogramBin (const HistogramBin< T > &toCopy)
 HistogramBin (const T &lower, const T &upper, bool lowerIncl=false, bool upperIncl=true)
 Create a new HistogramBin.
virtual HistogramBin< T > * clone (void) const
virtual double getValue (void) const
 return the 'count' of items in the bin
virtual bool isInBin (const T &value) const
 Check whether an item belongs in this bin.
virtual std::string toString (void) const
virtual void addValue (const T &value) throw ( ValueOutOfRangeException )
 Add a value to the bin.
virtual void clear (void)
 Clear the value of the bin.

Protected Attributes

bool lowerInclusive
bool upperInclusive
double binValue
double increment

Detailed Description

template<class T>
class HistogramBin< T >

Bin for histograms

T Type of value which the histogram bin contains; e.g. a histogram over packet counts would be a HistogramBin<int>. Must support Strict Weak Ordering - briefly, T::operator< must be implemented, and for two values of T T1 and T2, ( ! T1 < T2 ) and ( ! T2 < T1 ) iff T1 == T2.
HistogramBins use double values; normally the bin will contain a count, which would be an integer, but it's common enough to perform normalization and other transformations that it seems wise to support floating-point values.

Constructor & Destructor Documentation

template<class T>
HistogramBin< T >::HistogramBin const T &  lower,
const T &  upper,
bool  lowerIncl = false,
bool  upperIncl = true

Create a new HistogramBin.

Default behaviour is for the bin to be (lower,upper] - i.e. lower is not part of the bin, upper is. This means that a set of consecutive bins with default behaviour will cover all values in range without duplication, and with boundary values being put in the lower bin.

lower lower bound for bin
upper upper bound for bin
lowerIncl include value for lower bound
upperIncl include value for upper bound

Member Function Documentation

template<class T>
void HistogramBin< T >::addValue const T &  value  )  throw ( ValueOutOfRangeException ) [virtual]

Add a value to the bin.

ValueOutOfRangeException The value to be added to the bin is not within the range assigned to the bin.

template<class T>
double HistogramBin< T >::getValue void   )  const [virtual]

return the 'count' of items in the bin

value of the bin, normally a count of items in the bin, possibly normalized (hence the double return type)

The documentation for this class was generated from the following files:
Generated on Thu Apr 5 01:02:37 2007 for ANTARES by  doxygen 1.4.2