Package tigase.stats

# Class MaxDailyCounterQueue<E extends Number & Comparable<E>>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
tigase.stats.MaxDailyCounterQueue<E>

All Implemented Interfaces:
  `Iterable<E>`, `Collection<E>`, `Queue<E>`

public class MaxDailyCounterQueue<E extends Number & Comparable<E>> extends AbstractQueue<E>
A queue implementation which stores highest added value on a given day and has limited size.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MaxDailyCounterQueue(int maxQueueLength)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Optional<E>`
  `getMaxValue()`
  `Optional<E>`
  `getMaxValueInRange(int range)`
  `boolean`
  `isLimitSurpassed(int range, E limit)`
  Check if any item within range surpass the limit
  `boolean`
  `isLimitSurpassed(E limit)`
  Check if any item in the collection surpass the limit
  `boolean`
  `isLimitSurpassedAllItems(int range, E limit)`
  Check if all and every item within range surpass the limit
  `boolean`
  `isLimitSurpassedAllItems(E limit)`
  Check if all and every item in the collection surpass the limit
  `protected boolean`
  `isNextItem()`
  `Iterator<E>`
  `iterator()`
  `boolean`
  `offer(E added)`
  `E`
  `peek()`
  `E`
  `poll()`
  `int`
  `size()`
  `ArrayDeque<E>`
  `subQueue(int range)`
  `String`
  `toString()`

  ### Methods inherited from class java.util.AbstractQueue

  `add, addAll, clear, element, remove`

  ### Methods inherited from class java.util.AbstractCollection

  `contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray`

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

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

  ### Methods inherited from interface java.util.Collection

  `contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray`

  ### Methods inherited from interface java.lang.Iterable

  `forEach`

- ## Constructor Details

  - ### MaxDailyCounterQueue

    public MaxDailyCounterQueue(int maxQueueLength)

- ## Method Details

  - ### getMaxValue

    public Optional<E> getMaxValue()

  - ### getMaxValueInRange

    public Optional<E> getMaxValueInRange(int range)

  - ### isLimitSurpassed

    public boolean isLimitSurpassed(E limit)
    Check if any item in the collection surpass the limit
    Parameters:
      `limit` - against which items should be check
    Returns:
      indicating whether any item in the collection surpass the limit

  - ### isLimitSurpassed

    public boolean isLimitSurpassed(int range, E limit)
    Check if any item within range surpass the limit
    Parameters:
      `range` - number of items to check
      `limit` - against which items should be check
    Returns:
      indicating whether any item within range surpass the limit

  - ### isLimitSurpassedAllItems

    public boolean isLimitSurpassedAllItems(E limit)
    Check if all and every item in the collection surpass the limit
    Parameters:
      `limit` - against which items should be check
    Returns:
      indicating whether all items in the collection surpass the limit

  - ### isLimitSurpassedAllItems

    public boolean isLimitSurpassedAllItems(int range, E limit)
    Check if all and every item within range surpass the limit
    Parameters:
      `range` - number of items to check
      `limit` - against which items should be check
    Returns:
      indicating whether all items within range surpass the limit

  - ### iterator

    public Iterator<E> iterator()
    Specified by:
      `iterator` in interface `Collection<E extends Number & Comparable<E>>`
    Specified by:
      `iterator` in interface `Iterable<E extends Number & Comparable<E>>`
    Specified by:
      `iterator` in class `AbstractCollection<E extends Number & Comparable<E>>`

  - ### offer

    public boolean offer(E added)

  - ### peek

    public E peek()

  - ### poll

    public E poll()

  - ### size

    public int size()
    Specified by:
      `size` in interface `Collection<E extends Number & Comparable<E>>`
    Specified by:
      `size` in class `AbstractCollection<E extends Number & Comparable<E>>`

  - ### subQueue

    public ArrayDeque<E> subQueue(int range)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `AbstractCollection<E extends Number & Comparable<E>>`

  - ### isNextItem

    protected boolean isNextItem()