de.hfu.anybeam.networkCore

## Class AverageList

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.Vector<java.lang.Double>
      - - de.hfu.anybeam.networkCore.AverageList

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Double>, java.util.Collection<java.lang.Double>, java.util.List<java.lang.Double>, java.util.RandomAccess

      public class AverageList
      extends java.util.Vector<java.lang.Double>

  A `Vector` subclass providing functionality to calculate a average value over all values included in this list. Only the last max values are stored, all others are disposed.
  Since:
    1.0
  Version:
    1.0
  Author:
    chrwuer
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AverageList(int maxSize)` Creates a new `AverageList` object with the given max number of elements.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(java.lang.Double t)`
    `double` | `getAverage()` Calculates the average value of all elements in this list.

    - ### Methods inherited from class java.util.Vector

      `add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AverageList

          public AverageList(int maxSize)

      Creates a new `AverageList` object with the given max number of elements.
      Parameters:
        `maxSize` - the max number of elements in this list

  - ### Method Detail

    - #### add

          public boolean add(java.lang.Double t)

      Specified by:
        `add` in interface `java.util.Collection<java.lang.Double>`
      Specified by:
        `add` in interface `java.util.List<java.lang.Double>`
      Overrides:
        `add` in class `java.util.Vector<java.lang.Double>`

    - #### getAverage

          public double getAverage()

      Calculates the average value of all elements in this list.
      Returns:
        the calculated average