T - public class LossyCountingImpl<T> extends AbstractDataStructure<T,LossyCountingParameterDefinition> implements LossyCounting<T>
DataStructure.Type| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<T,java.lang.Integer> |
buckets |
protected int |
bucketSize |
protected int |
currentBucket |
protected double |
epsilon |
protected java.util.Map<T,java.lang.Integer> |
frequencies |
protected int |
items |
protected java.lang.Object |
mutex |
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 |
|---|
LossyCountingImpl(java.util.Map<LossyCountingParameterDefinition,DSParameter<?>> params) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<T> |
add(T e)
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.
|
protected java.util.Collection<T> |
clean() |
protected java.util.Collection<T> |
clean(java.util.Set<T> candidates) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
int |
getBucketOf(T e) |
int |
getBucketSize() |
int |
getCapacity() |
int |
getCurrentBucket() |
long |
getFrequencyOf(T e) |
double |
getMaximumApproximationError() |
long |
getSize() |
DataStructure.Type |
getType() |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
protected void |
remove(T t) |
protected double |
setBucketSize(int bucketSize) |
protected int |
setMaximumApproximationError(double epsilon) |
java.lang.String |
toString() |
getParameters, getUsedMemoryInBytesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParameters, getUsedMemoryInBytesprotected final java.util.Map<T,java.lang.Integer> buckets
protected int bucketSize
protected int currentBucket
protected double epsilon
protected final java.util.Map<T,java.lang.Integer> frequencies
protected int items
protected java.lang.Object mutex
public LossyCountingImpl(java.util.Map<LossyCountingParameterDefinition,DSParameter<?>> params)
public java.util.Collection<T> add(T e)
DataStructureadd in interface DataStructure<T>protected java.util.Collection<T> clean()
public void clear()
clear in interface DataStructure<T>public boolean contains(java.lang.Object o)
contains in interface DataStructure<T>public boolean containsAll(java.util.Collection<?> c)
public int getBucketOf(T e)
getBucketOf in interface LossyCounting<T>public int getBucketSize()
getBucketSize in interface LossyCounting<T>public int getCurrentBucket()
getCurrentBucket in interface LossyCounting<T>public long getFrequencyOf(T e)
getFrequencyOf in interface DataStructure<T>public double getMaximumApproximationError()
getMaximumApproximationError in interface LossyCounting<T>public boolean isEmpty()
isEmpty in interface DataStructure<T>public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>protected void remove(T t)
protected double setBucketSize(int bucketSize)
protected int setMaximumApproximationError(double epsilon)
public java.lang.String toString()
toString in class java.lang.Objectpublic DataStructure.Type getType()
getType in interface DataStructure<T>public long getSize()
getSize in interface DataStructure<T>public int getCapacity()
getCapacity in interface DataStructure<T>