org.modeshape.common.statistic

## Class Histogram.Bucket

- java.lang.Object
- - org.modeshape.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.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Histogram.Bucket(T lowerBound, T upperBound)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addValue(T value)` Add a value to this bucket
    `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.
    `protected Class<T>` | `getNumberClass()`
    `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.
    `int` | `hashCode()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Histogram.Bucket

          protected Histogram.Bucket(T lowerBound,
                          T upperBound)

  - ### 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.

    - #### addValue

          protected void addValue(T value)

      Add a value to this bucket
      Parameters:
        `value` -

    - #### 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>`

    - #### getNumberClass

          protected Class<T> getNumberClass()

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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