com.h3c.sdn.metric

## Class HistogramDataPoint

- java.lang.Object
- - com.h3c.sdn.metric.DataPoint
  - - com.h3c.sdn.metric.HistogramDataPoint

-     public class HistogramDataPoint
      extends DataPoint

  Class for a time stamped histogram data point.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `HistogramDataPoint.HistogramIndices` Indices used for storing `HistogramDataPoint` contents in a file.

    - ### Nested classes/interfaces inherited from class com.h3c.sdn.metric.DataPoint

      `DataPoint.Indices`

  - ### Field Summary

    - ### Fields inherited from class com.h3c.sdn.metric.DataPoint

      `ENCODING_CHAR_SET`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HistogramDataPoint(InputStream is)` Constructs a `HistogramDataPoint` from the specified stream contents.
    `HistogramDataPoint(long lastUpdatedTimeStamp, long msSpanned, long count, double mean, long minimum, long maximum, double standardDeviation)` Constructs a `HistogramDataPoint` using the specified values.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object toCompare)`
    `long` | `getCount()` Gets the number of samples encompassed by the histogram.
    `int` | `getExpectedFieldCount()` Gets the expected CSV field count for the data type.
    `long` | `getMaximum()` Gets the largest of the histogram sample values.
    `double` | `getMean()` Gets the arithmetic mean of histogram sample values.
    `long` | `getMinimum()` Gets the smallest of the histogram sample values.
    `double` | `getStandardDeviation()` Gets the arithmetic standard deviation of histogram sample values.
    `int` | `hashCode()`
    `protected String[]` | `prepareArrayFieldsForWriting(String[] fields)` Prepares the provided `String` array with values to be written for this `DataPoint`.
    `void` | `set(String[] fields)` Reads the `DataPoint` contents from the specified `String` array.
    `void` | `setCount(long toSet)` Sets the number of samples encompassed by the histogram.
    `void` | `setMaximum(long toSet)` Sets the largest of the histogram sample values.
    `void` | `setMean(double toSet)` Sets the arithmetic mean of histogram sample values.
    `void` | `setMinimum(long toSet)` Sets the smallest of the histogram sample values.
    `void` | `setStandardDeviation(double toSet)` Sets the arithmetic standard deviation of histogram sample values.
    `String` | `toDebugString()` Gets a detailed representation of this object to facilitate debugging.
    `String` | `toString()`

    - ### Methods inherited from class com.h3c.sdn.metric.DataPoint

      `getLastUpdatedTimeStamp, getMsSpanned, read, setLastUpdatedTimeStamp, setMsSpanned, write`

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

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

- - ### Constructor Detail

    - #### HistogramDataPoint

          public HistogramDataPoint(long lastUpdatedTimeStamp,
                            long msSpanned,
                            long count,
                            double mean,
                            long minimum,
                            long maximum,
                            double standardDeviation)

      Constructs a `HistogramDataPoint` using the specified values.
      Parameters:
        `lastUpdatedTimeStamp` - last updated time stamp
        `msSpanned` - milliseconds spanned
        `count` - number of sample values encompassed by histogram
        `mean` - arithmetic mean of histogram sample values
        `minimum` - smallest of histogram sample values
        `maximum` - largest of histogram sample values
        `standardDeviation` - arithmetic standard deviation of histogram sample values

    - #### HistogramDataPoint

          public HistogramDataPoint(InputStream is)
                             throws DataFormatException,
                                    IOException

      Constructs a `HistogramDataPoint` from the specified stream contents.
      Parameters:
        `is` - `InputStream` to read from
      Throws:
        `DataFormatException` - if the expected content cannot be read
        `IOException` - if an error occurs while reading from the stream

  - ### Method Detail

    - #### equals

          public boolean equals(Object toCompare)

      Overrides:
        `equals` in class `DataPoint`

    - #### getCount

          public long getCount()

      Gets the number of samples encompassed by the histogram.
      Returns:
        number of samples encompassed by histogram

    - #### getMaximum

          public long getMaximum()

      Gets the largest of the histogram sample values.
      Returns:
        largest histogram sample value

    - #### getMean

          public double getMean()

      Gets the arithmetic mean of histogram sample values.
      Returns:
        mean of histogram sample values

    - #### getMinimum

          public long getMinimum()

      Gets the smallest of the histogram sample values.
      Returns:
        smallest histogram sample value

    - #### getStandardDeviation

          public double getStandardDeviation()

      Gets the arithmetic standard deviation of histogram sample values.
      Returns:
        standard deviation of histogram sample values

    - #### getExpectedFieldCount

          public int getExpectedFieldCount()

      Description copied from class: `DataPoint`
      Gets the expected CSV field count for the data type.
      Overrides:
        `getExpectedFieldCount` in class `DataPoint`
      Returns:
        the expected field count

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `DataPoint`

    - #### prepareArrayFieldsForWriting

          protected String[] prepareArrayFieldsForWriting(String[] fields)

      Description copied from class: `DataPoint`
      Prepares the provided `String` array with values to be written for this `DataPoint`.
      Overrides:
        `prepareArrayFieldsForWriting` in class `DataPoint`
      Parameters:
        `fields` - a `String` array that will be set with the field values, in order, to be written
      Returns:
        array set with fields values from this object, in order

    - #### set

          public void set(String[] fields)
                   throws DataFormatException

      Description copied from class: `DataPoint`
      Reads the `DataPoint` contents from the specified `String` array.
      Overrides:
        `set` in class `DataPoint`
      Parameters:
        `fields` - `String` array to read from
      Throws:
        `DataFormatException` - if the expected file content cannot be read

    - #### setCount

          public void setCount(long toSet)

      Sets the number of samples encompassed by the histogram.
      Parameters:
        `toSet` - number of samples encompassed by histogram

    - #### setMaximum

          public void setMaximum(long toSet)

      Sets the largest of the histogram sample values.
      Parameters:
        `toSet` - largest histogram sample value

    - #### setMean

          public void setMean(double toSet)

      Sets the arithmetic mean of histogram sample values.
      Parameters:
        `toSet` - arithmetic mean of histogram sample values

    - #### setMinimum

          public void setMinimum(long toSet)

      Sets the smallest of the histogram sample values.
      Parameters:
        `toSet` - smallest histogram sample value

    - #### setStandardDeviation

          public void setStandardDeviation(double toSet)

      Sets the arithmetic standard deviation of histogram sample values.
      Parameters:
        `toSet` - arithmetic standard deviation of histogram sample values

    - #### toDebugString

          public String toDebugString()

      Description copied from class: `DataPoint`
      Gets a detailed representation of this object to facilitate debugging.
      Overrides:
        `toDebugString` in class `DataPoint`
      Returns:
        debug representation of object

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `DataPoint`

Copyright © 2014. All Rights Reserved.