Class FrequentItemsSketch.Row<T>

java.lang.Object
org.apache.datasketches.frequencies.FrequentItemsSketch.Row<T>
Type Parameters:
T - type of item
All Implemented Interfaces:
Comparable<FrequentItemsSketch.Row<T>>
Enclosing class:
FrequentItemsSketch<T>

public static class FrequentItemsSketch.Row<T> extends Object implements Comparable<FrequentItemsSketch.Row<T>>
Row class that defines the return values from a getFrequentItems query.
Author:
Justin Thaler, Alexander Saydakov
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    This compareTo is strictly limited to the Row.getEstimate() value and does not imply any ordering whatsoever to the other elements of the row: item and upper and lower bounds.
    boolean
    This equals is computed only from the Row.getEstimate() value and does not imply equality of the other items within the row: item and upper and lower bounds.
    long
    Returns the estimate
    Returns an item of type T
    long
    Returns the lower bound
    static String
    Returns the descriptive row header
    long
    Returns the upper bound
    int
    This hashCode is computed only from the Row.getEstimate() value.
     

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • getItem

      public T getItem()
      Returns an item of type T
      Returns:
      item of type T
    • getEstimate

      public long getEstimate()
      Returns the estimate
      Returns:
      the estimate
    • getUpperBound

      public long getUpperBound()
      Returns the upper bound
      Returns:
      the upper bound
    • getLowerBound

      public long getLowerBound()
      Returns the lower bound
      Returns:
      return the lower bound
    • getRowHeader

      public static String getRowHeader()
      Returns the descriptive row header
      Returns:
      the descriptive row header
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(FrequentItemsSketch.Row<T> that)
      This compareTo is strictly limited to the Row.getEstimate() value and does not imply any ordering whatsoever to the other elements of the row: item and upper and lower bounds. Defined this way, this compareTo will be consistent with hashCode() and equals(Object).
      Specified by:
      compareTo in interface Comparable<T>
      Parameters:
      that - the other row to compare to.
      Returns:
      a negative integer, zero, or a positive integer as this.getEstimate() is less than, equal to, or greater than that.getEstimate().
    • hashCode

      public int hashCode()
      This hashCode is computed only from the Row.getEstimate() value. Defined this way, this hashCode will be consistent with equals(Object):
      If (x.equals(y)) implies: x.hashCode() == y.hashCode().
      If (!x.equals(y)) does NOT imply: x.hashCode() != y.hashCode().
      Overrides:
      hashCode in class Object
      Returns:
      the hashCode computed from getEstimate().
    • equals

      public boolean equals(Object obj)
      This equals is computed only from the Row.getEstimate() value and does not imply equality of the other items within the row: item and upper and lower bounds. Defined this way, this equals will be consistent with compareTo(Row).
      Overrides:
      equals in class Object
      Parameters:
      obj - the other row to determine equality with.
      Returns:
      true if this.getEstimate() equals ((Row<T>)obj).getEstimate().