public class CountMinSketchImpl<T> extends AbstractDataStructure<T,CountMinSketchParameterDefinition> implements SketchBasedDataStructure<T>
DataStructure.Type
Modifier and Type | Field and Description |
---|---|
static long |
PRIME_MODULUS |
FINITE_ITERABLE_DATA_STRUCTURES, FINITE_ITERABLE_POINTER_DATA_STRUCTURES, FINITE_POINTER_DATA_STRUCTURES, INFIITE_DATA_STRUCTURES, ITERABLE_DATA_STRUCTURES, POINTER_DATA_STRUCTURES
Constructor and Description |
---|
CountMinSketchImpl(java.util.Map<CountMinSketchParameterDefinition,DSParameter<?>> params) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<T> |
add(T item)
add elements to a stream based data structure may lead to removal of
other elements in the data structure If possible, the implementing
algorithm will return a collection of elements.
|
void |
clear() |
boolean |
contains(java.lang.Object o) |
long |
estimateCount(T item)
The estimate is correct within 'epsilon' * (total item count), with
probability 'confidence'.
|
int |
getCapacity() |
double |
getConfidence() |
protected int |
getDepth() |
long |
getFrequencyOf(T e) |
double |
getRelativeError() |
long |
getSize() |
protected long[][] |
getTable() |
DataStructure.Type |
getType() |
protected int |
getWidth() |
boolean |
isEmpty() |
void |
setSize(long size) |
long |
size() |
getParameters, getUsedMemoryInBytes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameters, getUsedMemoryInBytes
public static final long PRIME_MODULUS
public CountMinSketchImpl(java.util.Map<CountMinSketchParameterDefinition,DSParameter<?>> params)
public java.util.Collection<T> add(T item)
DataStructure
add
in interface DataStructure<T>
public void clear()
clear
in interface DataStructure<T>
public boolean contains(java.lang.Object o)
contains
in interface DataStructure<T>
public long estimateCount(T item)
public int getCapacity()
getCapacity
in interface DataStructure<T>
public double getConfidence()
protected int getDepth()
public long getFrequencyOf(T e)
getFrequencyOf
in interface DataStructure<T>
public double getRelativeError()
public long getSize()
getSize
in interface DataStructure<T>
protected long[][] getTable()
public DataStructure.Type getType()
getType
in interface DataStructure<T>
protected int getWidth()
public boolean isEmpty()
isEmpty
in interface DataStructure<T>
public void setSize(long size)
public long size()