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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMaxValueInRange(int range) booleanisLimitSurpassed(int range, E limit) Check if any item within range surpass the limitbooleanisLimitSurpassed(E limit) Check if any item in the collection surpass the limitbooleanisLimitSurpassedAllItems(int range, E limit) Check if all and every item within range surpass the limitbooleanisLimitSurpassedAllItems(E limit) Check if all and every item in the collection surpass the limitprotected booleaniterator()booleanpeek()poll()intsize()subQueue(int range) toString()Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
iteratorin interfaceCollection<E extends Number & Comparable<E>>- Specified by:
iteratorin interfaceIterable<E extends Number & Comparable<E>>- Specified by:
iteratorin classAbstractCollection<E extends Number & Comparable<E>>
-
offer
-
peek
-
poll
-
size
public int size()- Specified by:
sizein interfaceCollection<E extends Number & Comparable<E>>- Specified by:
sizein classAbstractCollection<E extends Number & Comparable<E>>
-
subQueue
-
toString
- Overrides:
toStringin classAbstractCollection<E extends Number & Comparable<E>>
-
isNextItem
protected boolean isNextItem()
-