T - The type of item to storepublic abstract class AbstractTopKBottomKFinder<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected DoublyLinkedList<org.wso2.extension.siddhi.execution.extrema.util.AbstractTopKBottomKFinder.Bucket> |
bucketList |
| Constructor and Description |
|---|
AbstractTopKBottomKFinder(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
abstract List<Counter<T>> |
get(int k)
Get results from the current data structure
Results depends on whether topK or bottomK is required
|
protected abstract org.wso2.extension.siddhi.execution.extrema.util.AbstractTopKBottomKFinder.Bucket |
getBucketWithCounterToReplace()
Returns the bucket with the counter with least importance
|
void |
offer(T item)
Increases the frequency of the item by 1
|
void |
offer(T item,
int incrementCount)
Increases the frequency of the item by the specified amount
|
protected DoublyLinkedList<org.wso2.extension.siddhi.execution.extrema.util.AbstractTopKBottomKFinder.Bucket> bucketList
public AbstractTopKBottomKFinder(int capacity)
capacity - Maximum number of unique items to keeppublic void offer(T item)
item - Item to increase the frequency ofpublic void offer(T item, int incrementCount)
item - Item to increase the frequency ofpublic abstract List<Counter<T>> get(int k)
k - The number of elements to fetchprotected abstract org.wso2.extension.siddhi.execution.extrema.util.AbstractTopKBottomKFinder.Bucket getBucketWithCounterToReplace()
Copyright © 2017 WSO2. All rights reserved.