com.h3c.sdn.metric

## Class CounterDataPoint

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

-     public class CounterDataPoint
      extends DataPoint

  Class for a time stamped counter data point.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `CounterDataPoint.CounterIndices` Indices used for storing `CounterDataPoint` 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
    `CounterDataPoint(InputStream is)` Constructs a `CounterDataPoint` from the specified stream contents.
    `CounterDataPoint(long lastUpdatedTimeStamp, long msSpanned, long count)` Constructs a `CounterDataPoint` using the specified values.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object toCompare)`
    `long` | `getCount()` Gets the count value.
    `int` | `getExpectedFieldCount()` Gets the expected CSV field count for the data type.
    `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 count value.
    `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

    - #### CounterDataPoint

          public CounterDataPoint(long lastUpdatedTimeStamp,
                          long msSpanned,
                          long count)

      Constructs a `CounterDataPoint` using the specified values.
      Parameters:
        `lastUpdatedTimeStamp` - last updated time stamp
        `msSpanned` - milliseconds spanned
        `count` - count value

    - #### CounterDataPoint

          public CounterDataPoint(InputStream is)
                           throws DataFormatException,
                                  IOException

      Constructs a `CounterDataPoint` 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 count value.
      Returns:
        count value

    - #### 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 count value.
      Parameters:
        `toSet` - count value

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