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>
A queue implementation which stores highest added value on a given day
and has limited size.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMaxValueInRange
(int range) boolean
isLimitSurpassed
(int range, E limit) Check if any item within range surpass the limitboolean
isLimitSurpassed
(E limit) Check if any item in the collection surpass the limitboolean
isLimitSurpassedAllItems
(int range, E limit) Check if all and every item within range surpass the limitboolean
isLimitSurpassedAllItems
(E limit) Check if all and every item in the collection surpass the limitprotected boolean
iterator()
boolean
peek()
poll()
int
size()
subQueue
(int range) toString()
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
-
Constructor Details
-
MaxDailyCounterQueue
public MaxDailyCounterQueue(int maxQueueLength)
-
-
Method Details
-
getMaxValue
-
getMaxValueInRange
-
isLimitSurpassed
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
Check if any item within range surpass the limit- Parameters:
range
- number of items to checklimit
- against which items should be check- Returns:
- indicating whether any item within range surpass the limit
-
isLimitSurpassedAllItems
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
Check if all and every item within range surpass the limit- Parameters:
range
- number of items to checklimit
- against which items should be check- Returns:
- indicating whether all items within range surpass the limit
-
iterator
- Specified by:
iterator
in interfaceCollection<E extends Number & Comparable<E>>
- Specified by:
iterator
in interfaceIterable<E extends Number & Comparable<E>>
- Specified by:
iterator
in classAbstractCollection<E extends Number & Comparable<E>>
-
offer
-
peek
-
poll
-
size
public int size()- Specified by:
size
in interfaceCollection<E extends Number & Comparable<E>>
- Specified by:
size
in classAbstractCollection<E extends Number & Comparable<E>>
-
subQueue
-
toString
- Overrides:
toString
in classAbstractCollection<E extends Number & Comparable<E>>
-
isNextItem
protected boolean isNextItem()
-