Class CountMinSketchAgentStringUTF16
java.lang.Object
com.espertech.esper.common.client.util.CountMinSketchAgentStringUTF16
- All Implemented Interfaces:
CountMinSketchAgent
Count-min sketch agent that handles String-type values and uses UTF-16 encoding
to transform strings to byte-array and back.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a value to the Count-min sketch.Return the estimated count for a given value.Return the value object for a given byte-array, for use with top-K.
-
Field Details
-
EPTYPE
Type information
-
-
Constructor Details
-
CountMinSketchAgentStringUTF16
public CountMinSketchAgentStringUTF16()
-
-
Method Details
-
add
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 interfaceCountMinSketchAgent
- 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 interfaceCountMinSketchAgent
- 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 interfaceCountMinSketchAgent
- Parameters:
ctx
- value object and state- Returns:
- value object
-