Class CountMinSketchAgentStringUTF16

java.lang.Object
com.espertech.esper.common.client.util.CountMinSketchAgentStringUTF16
All Implemented Interfaces:
CountMinSketchAgent

public class CountMinSketchAgentStringUTF16 extends Object implements CountMinSketchAgent
Count-min sketch agent that handles String-type values and uses UTF-16 encoding to transform strings to byte-array and back.
  • Field Details

    • EPTYPE

      public static final EPTypeClass EPTYPE
      Type information
  • Constructor Details

    • CountMinSketchAgentStringUTF16

      public CountMinSketchAgentStringUTF16()
  • Method Details

    • add

      public void add(CountMinSketchAgentContextAdd ctx)
      Description copied from interface: CountMinSketchAgent
      Add a value to the Count-min sketch. Implementations typically check for null value, convert the value object to a byte-array and invoke a method on the state object to add the byte-array value.
      Specified by:
      add in interface CountMinSketchAgent
      Parameters:
      ctx - contains value to add as well as the state
    • estimate

      Description copied from interface: CountMinSketchAgent
      Return the estimated count for a given value. Implementations typically check for null value, convert the value object to a byte-array and invoke a method on the state object to retrieve a count.
      Specified by:
      estimate in interface CountMinSketchAgent
      Parameters:
      ctx - contains value to query as well as the state
      Returns:
      estimated count
    • fromBytes

      Description copied from interface: CountMinSketchAgent
      Return the value object for a given byte-array, for use with top-K. Implementations typically simply convert a byte-array into a value object.
      Specified by:
      fromBytes in interface CountMinSketchAgent
      Parameters:
      ctx - value object and state
      Returns:
      value object