Package com.cobber.fta
Class TopBottomK<T extends java.lang.Comparable<C>,C>
- java.lang.Object
-
- com.cobber.fta.TopBottomK<T,C>
-
- Type Parameters:
T
- The type of the object being tracked.C
- The Class of a comparator used to compare objects of this type.
public class TopBottomK<T extends java.lang.Comparable<C>,C> extends java.lang.Object
Class used to track the top and bottom K values.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.SortedSet<T>
bottomK()
Return the bottom K values (ordered lowest to highest).java.util.SortedSet<java.lang.String>
bottomKasString()
Return the bottom K values as Strings (ordered lowest to highest).void
observe(T item)
Observe the value provided.java.util.SortedSet<T>
topK()
Return the top K values (ordered lowest to highest).java.util.SortedSet<java.lang.String>
topKasString()
Return the top K values as Strings (ordered highest to lowest).
-
-
-
Method Detail
-
observe
public void observe(T item)
Observe the value provided.- Parameters:
item
- The item to be observed.
-
topK
public java.util.SortedSet<T> topK()
Return the top K values (ordered lowest to highest).- Returns:
- The top K values.
-
bottomK
public java.util.SortedSet<T> bottomK()
Return the bottom K values (ordered lowest to highest).- Returns:
- The bottom K values.
-
topKasString
public java.util.SortedSet<java.lang.String> topKasString()
Return the top K values as Strings (ordered highest to lowest).- Returns:
- The top K values as Strings.
-
bottomKasString
public java.util.SortedSet<java.lang.String> bottomKasString()
Return the bottom K values as Strings (ordered lowest to highest).- Returns:
- The bottom K values as Strings.
-
-