public abstract class AbstractForwardDecayDataStructureImpl<T,P extends DSParameterDefinition> extends AbstractDataStructure<T,P> implements DecayDataStructure<T>
DataStructure.Type
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 |
---|
AbstractForwardDecayDataStructureImpl(java.util.Map<P,DSParameter<?>> params,
DecayFunction f,
int renewalRate,
double threshold) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<T> |
add(T t)
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() |
void |
clear() |
boolean |
contains(java.lang.Object o) |
protected int |
findMaxIndexOfItemsToRemove(int from,
int to,
double divisor) |
int |
getCapacity() |
java.util.Map<T,java.util.Queue<java.lang.ref.WeakReference<ItemDecayValuePair<T>>>> |
getCounts() |
DecayFunction |
getDecayFunction() |
long |
getFrequencyOf(T e) |
java.util.List<ItemDecayValuePair<T>> |
getItems() |
long |
getLandMark() |
int |
getRenewalRate() |
long |
getSize() |
double |
getThreshold() |
long |
getTime() |
DataStructure.Type |
getType() |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
void |
setLandMark(long landMark) |
void |
setTime(long time) |
getParameters, getUsedMemoryInBytes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameters, getUsedMemoryInBytes
public AbstractForwardDecayDataStructureImpl(java.util.Map<P,DSParameter<?>> params, DecayFunction f, int renewalRate, double threshold)
public java.util.Collection<T> add(T t)
DataStructure
add
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>
protected int findMaxIndexOfItemsToRemove(int from, int to, double divisor)
public int getCapacity()
getCapacity
in interface DataStructure<T>
public java.util.Map<T,java.util.Queue<java.lang.ref.WeakReference<ItemDecayValuePair<T>>>> getCounts()
public DecayFunction getDecayFunction()
getDecayFunction
in interface DecayDataStructure<T>
public long getFrequencyOf(T e)
getFrequencyOf
in interface DataStructure<T>
public java.util.List<ItemDecayValuePair<T>> getItems()
public long getLandMark()
public int getRenewalRate()
public long getSize()
getSize
in interface DataStructure<T>
public double getThreshold()
public long getTime()
public DataStructure.Type getType()
getType
in interface DataStructure<T>
public boolean isEmpty()
isEmpty
in interface DataStructure<T>
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public void setLandMark(long landMark)
public void setTime(long time)