Class TopBottomK<T extends java.lang.Comparable<C>,​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).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.