public class ReservoirImpl<T> extends AbstractDataStructure<T,ReservoirParameterDefinition> implements Reservoir<T>
DataStructure.Type| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList<T> |
internalStore |
protected int |
maxSize |
protected int |
members |
protected java.util.Random |
rGen |
protected int |
totalElements |
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 |
|---|
ReservoirImpl(java.util.Map<ReservoirParameterDefinition,DSParameter<?>> params) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<T> |
add(T e)
if we did not yet filled all spots, the element is always included.
|
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
int |
getCapacity() |
long |
getFrequencyOf(T e) |
long |
getSize() |
DataStructure.Type |
getType() |
int |
indexOf(T t) |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
void |
set(int i,
T t) |
java.lang.String |
toString() |
getParameters, getUsedMemoryInBytesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParameters, getUsedMemoryInBytesprotected final java.util.ArrayList<T> internalStore
protected final int maxSize
protected int members
protected int totalElements
protected final java.util.Random rGen
public ReservoirImpl(java.util.Map<ReservoirParameterDefinition,DSParameter<?>> params)
public java.util.Collection<T> add(T e)
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 boolean containsAll(java.util.Collection<?> c)
public boolean isEmpty()
isEmpty in interface DataStructure<T>public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>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>public long getFrequencyOf(T e)
getFrequencyOf in interface DataStructure<T>