public class CorrelationStack<RecordType>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList<Correlation<RecordType>> |
buffer
buffer is a LILO stack of correlations with the oldest correlations having the smallest indices.
|
protected Correlator<?,RecordType,?> |
correlator
Correlator
|
protected Correlation<RecordType> |
lastCorrelation |
protected int |
stackSize |
Constructor and Description |
---|
CorrelationStack(Correlator<?,RecordType,?> aCorrelator,
int aStackSize)
Creates a new instance of CorrelationStack
|
Modifier and Type | Method and Description |
---|---|
void |
clearBuffer()
Empty all correlations from the buffer.
|
int |
getCorrelationCount()
Get the number of correlations on the stack.
|
boolean |
isEmpty()
Determines whether there are any correlations left on the stack.
|
java.util.List<Correlation<RecordType>> |
popAllCorrelations()
Pop all correlations from the stack.
|
Correlation<RecordType> |
popCorrelation()
Removes the oldest correlation in the buffer and returns it.
|
protected void |
push(Correlation<RecordType> correlation)
Push a correlation onto the stack.
|
protected void |
trimBuffer()
Trim the buffer down to the stackSize by removing the oldest correlations.
|
protected java.util.LinkedList<Correlation<RecordType>> buffer
protected int stackSize
protected Correlation<RecordType> lastCorrelation
protected Correlator<?,RecordType,?> correlator
public CorrelationStack(Correlator<?,RecordType,?> aCorrelator, int aStackSize)
public int getCorrelationCount()
public boolean isEmpty()
public void clearBuffer()
public Correlation<RecordType> popCorrelation() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- if there are no correlations on the stack.public java.util.List<Correlation<RecordType>> popAllCorrelations()
protected void push(Correlation<RecordType> correlation)
correlation
- The correlation to push onto the stack.protected void trimBuffer()