Class AbstractLinearCounting


public abstract class AbstractLinearCounting extends Object
Linear counter, implemented based on pseudo code from and its appendix Trying to understand what this class does without having read the paper is considered adventurous. The algorithm just keep a record of all distinct values provided encoded as an integer.
  • Field Details

  • Constructor Details

    • AbstractLinearCounting

      public AbstractLinearCounting(int precision)
  • Method Details

    • addEncoded

      protected abstract int addEncoded(long bucketOrd, int encoded)
      Add encoded value to the linear counting. Implementor should only accept the value if it has not been seen before.
    • size

      protected abstract int size(long bucketOrd)
      number of values in the counter.
    • values

      protected abstract AbstractLinearCounting.HashesIterator values(long bucketOrd)
      return the current values in the counter.
    • collect

      public int collect(long bucketOrd, long hash)
    • cardinality

      public long cardinality(long bucketOrd)
      Returns the current computed cardinality
    • precision

      public int precision()
      Precision of the algorithm