public class Median extends Filter
Class that calculates the median of a data sequence.
Filter.Mode
Constructor and Description |
---|
Median(DataSource original,
int windowSize,
int offset,
Filter.Mode mode,
int... cols)
Creates a new Median object with the specified DataSource, window
size, offset, Mode, and columns.
|
Modifier and Type | Method and Description |
---|---|
protected void |
filter()
Invokes the filtering routine.
|
int |
getOffset()
Returns the offset from the current value used to calculate the
median to the last value of the window.
|
int |
getWindowSize()
Returns the size of the window which is used to calculate the median.
|
void |
setOffset(int offset)
Sets the offset from the current value used to calculate the
median to the last value of the window.
|
void |
setWindowSize(int windowSize)
Set the size of the window which is used to calculate the median.
|
add, add, clear, dataAdded, dataRemoved, dataUpdated, get, getColumnCount, getColumnCountFiltered, getIndex, getIndexOriginal, getMode, getOriginal, getOriginal, getRowCount, getRowCountFiltered, isFiltered, set, setMode
addDataListener, getColumn, getColumnTypes, getRow, getStatistics, isColumnNumeric, iterator, notifyDataAdded, notifyDataRemoved, notifyDataUpdated, removeDataListener, setColumnTypes
public Median(DataSource original, int windowSize, int offset, Filter.Mode mode, int... cols)
original
- DataSource to be filtered.windowSize
- Number of rows to be used for the calculation of the
median.offset
- Offset from the current filtered value to the last value
of the window.mode
- Mode of filtering.cols
- Column indexes.protected void filter()
Filter
public int getWindowSize()
public void setWindowSize(int windowSize)
windowSize
- Number of rows used.public int getOffset()
public void setOffset(int offset)
offset
- Offset.