Class ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    ApproximateUnique.ApproximateUniqueCombineFn<T>

    public static class ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique
    extends java.lang.Object
    implements java.io.Serializable
    A heap utility class to efficiently track the largest added elements.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      LargestUnique​(long sampleSize)
      Creates a heap to track the largest sampleSize elements.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(long value)
      Adds a value to the heap, returning whether the value is (large enough to be) in the heap.
      boolean equals​(@Nullable java.lang.Object o)  
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LargestUnique

        public LargestUnique​(long sampleSize)
        Creates a heap to track the largest sampleSize elements.
        Parameters:
        sampleSize - the size of the heap
    • Method Detail

      • add

        public boolean add​(long value)
        Adds a value to the heap, returning whether the value is (large enough to be) in the heap.
      • equals

        public boolean equals​(@Nullable java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object