com.h3c.sdn.metric

## Class DataPointList<T extends DataPoint>

- java.lang.Object
- - com.h3c.sdn.metric.DataPointList<T>

- Direct Known Subclasses:
    CounterDataPointList, GaugeDataPointList, HistogramDataPointList, MeterDataPointList, RatioGaugeDataPointList, RollingCounterDataPointList, TimerDataPointList

      public abstract class DataPointList<T extends DataPoint>
      extends Object

  A list of `DataPoint` objects.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataPointList()` Creates a new, empty list of `DataPoint` objects.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(T toAdd)` Inserts the specified `DataPoint` element into the list, ordered by its last update time.
    `protected void` | `checkForEmptyList()` Checks for an empty list and a list with one element in it.
    `void` | `clear()` Removes all of the `DataPoint` elements from this list.
    `boolean` | `contains(T toFind)` Indicates whether this list contains an object equivalent to the specified `DataPoint` instance.
    `protected List<T>` | `getList()` Gets the list of `DataPoint` objects.
    `boolean` | `isEmpty()` Indicates whether this list contains any `DataPoint` elements.
    `boolean` | `remove(T toRemove)` Removes the first equivalent occurrence of the specified `DataPoint` object from this list; the list is unchanged if no such `DataPoint` element is found.
    `int` | `size()` Returns the number of `DataPoint` elements in this list.
    `abstract T` | `summarize()` Summarizes the `DataPoint` elements contained within this list into a single `DataPoint` instance that encompasses the entire time frame spanned by the list contents.
    `String` | `toDebugString()` Gets a detailed representation of this object to facilitate debugging.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### DataPointList

          public DataPointList()

      Creates a new, empty list of `DataPoint` objects.

  - ### Method Detail

    - #### add

          public void add(T toAdd)

      Inserts the specified `DataPoint` element into the list, ordered by its last update time.
      Throws:
        `IllegalArgumentException` - if time spanned by the `DataPoint` to be added overlaps with the time spanned by another `DataPoint` in the list

    - #### checkForEmptyList

          protected void checkForEmptyList()
                                    throws UnsupportedOperationException

      Checks for an empty list and a list with one element in it. If the list contains a single `DataPoint` then it is returned as the summary.
      Throws:
        `UnsupportedOperationException` - if the list is empty

    - #### clear

          public void clear()

      Removes all of the `DataPoint` elements from this list.

    - #### contains

          public boolean contains(T toFind)

      Indicates whether this list contains an object equivalent to the specified `DataPoint` instance.
      Returns:
        `true` if list contains an equivalent object, `false` otherwise

    - #### getList

          protected List<T> getList()

      Gets the list of `DataPoint` objects.

    - #### isEmpty

          public boolean isEmpty()

      Indicates whether this list contains any `DataPoint` elements.
      Returns:
        `true` if list is empty, `false` otherwise

    - #### remove

          public boolean remove(T toRemove)

      Removes the first equivalent occurrence of the specified `DataPoint` object from this list; the list is unchanged if no such `DataPoint` element is found.
      Returns:
        `true` if an equivalent `DataPoint` was removed, `false` otherwise

    - #### size

          public int size()

      Returns the number of `DataPoint` elements in this list.
      Returns:
        number of elements in list

    - #### summarize

          public abstract T summarize()
                                                 throws UnsupportedOperationException

      Summarizes the `DataPoint` elements contained within this list into a single `DataPoint` instance that encompasses the entire time frame spanned by the list contents.
      Returns:
        single `DataPoint` encompassing contents of list
      Throws:
        `UnsupportedOperationException` - if the list is empty

    - #### toDebugString

          public String toDebugString()

      Gets a detailed representation of this object to facilitate debugging.
      Returns:
        debug representation of object

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014. All Rights Reserved.