org.jboss.dna.common.statistic
Class Histogram.Bucket

java.lang.Object
  extended by org.jboss.dna.common.statistic.Histogram.Bucket
All Implemented Interfaces:
Comparable<Histogram.Bucket>
Enclosing class:
Histogram<T extends Number>

public class Histogram.Bucket
extends Object
implements Comparable<Histogram.Bucket>

Represents a bucket in a histogram.


Method Summary
 int checkValue(T value, boolean isLast)
          Check whether the value fits in this bucket.
 int compareTo(Histogram.Bucket that)
           
 boolean equals(Object obj)
           
 T getLowerBound()
          Get the lower bound of this bucket.
 long getNumberOfValues()
          Get the number of values in this bucket.
 float getPercentageOfValues()
          Return the percentage of values in the histogram that appear in this bucket.
 T getUpperBound()
          Get the upper bound of this bucket.
 T getWidth()
          Get the width of this bucket.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getLowerBound

public T getLowerBound()
Get the lower bound of this bucket.

Returns:
the lower bound

getUpperBound

public T getUpperBound()
Get the upper bound of this bucket.

Returns:
the upper bound

getWidth

public T getWidth()
Get the width of this bucket.

Returns:
the width

getPercentageOfValues

public float getPercentageOfValues()
Return the percentage of values in the histogram that appear in this bucket.

Returns:
the percentage of all values in the histogram that appear in this bucket.

getNumberOfValues

public long getNumberOfValues()
Get the number of values in this bucket.

Returns:
the number of values

checkValue

public int checkValue(T value,
                      boolean isLast)
Check whether the value fits in this bucket.

Parameters:
value - the value to check
isLast -
Returns:
0 if the value fits in this bucket, -1 if the value fits in a prior bucket, or 1 if the value fits in a later bucket

compareTo

public int compareTo(Histogram.Bucket that)
Specified by:
compareTo in interface Comparable<Histogram.Bucket>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.