tigase.stats

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

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

- Type Parameters:
    `E` -
  All Implemented Interfaces:
    Serializable, Cloneable, Iterable<E>, Collection<E>, Deque<E>, Queue<E>

      public class MaxDailyCounterQueue<E extends Number & Comparable<E>>
      extends ArrayDeque<E>

  A queue implementation which stores highest added value on a given day and has limited size.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MaxDailyCounterQueue(int maxQueueLength)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(E added)`
    `Optional<E>` | `getMaxValue()`
    `Optional<E>` | `getMaxValueInRange(int range)`
    `boolean` | `isLimitSurpassed(E limit)` Check if any item in the collection surpass the limit
    `boolean` | `isLimitSurpassed(int range, E limit)` Check if any item within range surpass the limit
    `boolean` | `isLimitSurpassedAllItems(E limit)` Check if all and every item in the collection surpass the limit
    `boolean` | `isLimitSurpassedAllItems(int range, E limit)` Check if all and every item within range surpass the limit
    `protected boolean` | `isNextItem()`
    `ArrayDeque<E>` | `subQueue(int range)`
    `String` | `toString()`

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

      `addFirst, addLast, clear, clone, contains, descendingIterator, element, getFirst, getLast, isEmpty, iterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, size, spliterator, toArray, toArray`

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

      `addAll, containsAll, removeAll, retainAll`

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

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

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

      `addAll, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, stream`

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

      `forEach`

- - ### Constructor Detail

    - #### MaxDailyCounterQueue

          public MaxDailyCounterQueue(int maxQueueLength)

  - ### Method Detail

    - #### add

          public boolean add(E added)

      Specified by:
        `add` in interface `Collection<E extends Number & Comparable<E>>`
      Specified by:
        `add` in interface `Deque<E extends Number & Comparable<E>>`
      Specified by:
        `add` in interface `Queue<E extends Number & Comparable<E>>`
      Overrides:
        `add` in class `ArrayDeque<E extends Number & Comparable<E>>`

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

    - #### subQueue

          public ArrayDeque<E> subQueue(int range)

    - #### isNextItem

          protected boolean isNextItem()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractCollection<E extends Number & Comparable<E>>`

Copyright © 2022 "Tigase, Inc.". All rights reserved.