suramadu.util.stats
Interface Range

All Known Implementing Classes:
HistogramBin

public interface Range

An interface representing a range of values, and a counter to tally the number of values that fall within this range. It is used to abstract a bin in a histogram.

Author:
mbi

Method Summary
 long getCount()
          Get the count of the number of values that fall within this range.
 java.lang.Comparable getHiBound()
          Get the high bound of the range.
 java.lang.Comparable getLoBound()
          Get the lower bound of the range.
 Range merge(Range range)
          A helper method that will merge this range with another range iff the ranges are adjescent.
 

Method Detail

getHiBound

public java.lang.Comparable getHiBound()
Get the high bound of the range. This is the value that is greater than all values in the range.

Returns:
an object that implements the Comparable interface. This is usually a subclass of the Number object, such as Integer, Float, Double, etc.

getLoBound

public java.lang.Comparable getLoBound()
Get the lower bound of the range. This is the value that is less than or equal to all values in the range.

Returns:
an object that implements the Comparable interface. This is usually a subclass of the Number object, such as Integer, Float, Double, etc.

getCount

public long getCount()
Get the count of the number of values that fall within this range.

Returns:
an object that implements the Comparable interface. This is usually a subclass of the Number object, such as Integer, Float, Double, etc.
See Also:
getHiBound(), getLoBound()

merge

public Range merge(Range range)
A helper method that will merge this range with another range iff the ranges are adjescent.

Parameters:
range - the Range object to merge with this range.
Returns:
a new Object that implements the Range interface which encompasses both the current Range, and the specified Range. If the two ranges are not adjascent, then <null> is returned.