de.erichseifert.gral.data.filters
Class Median
- java.lang.Object
-
- de.erichseifert.gral.data.AbstractDataSource
-
- de.erichseifert.gral.data.filters.Filter2D
-
- de.erichseifert.gral.data.filters.Median
-
- All Implemented Interfaces:
- DataListener, DataSource, java.io.Serializable, java.lang.Iterable<java.lang.Comparable<?>>
public class Median extends Filter2D
Class that calculates the median of a data sequence.
- Setting and getting offset
- Setting and getting window size
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.erichseifert.gral.data.filters.Filter2D
Filter2D.Mode
-
-
Constructor Summary
Constructors Constructor and Description Median(DataSource original, int windowSize, int offset, Filter2D.Mode mode, int... cols)Creates a new Median object with the specified DataSource, window size, offset, Mode, and columns.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetOffset()Returns the offset from the current value used to calculate the median to the last value of the window.intgetWindowSize()Returns the size of the window which is used to calculate the median.voidsetOffset(int offset)Sets the offset from the current value used to calculate the median to the last value of the window.voidsetWindowSize(int windowSize)Set the size of the window which is used to calculate the median.-
Methods inherited from class de.erichseifert.gral.data.filters.Filter2D
dataAdded, dataRemoved, dataUpdated, get, getColumnCount, getMode, getRowCount, setMode
-
Methods inherited from class de.erichseifert.gral.data.AbstractDataSource
addDataListener, getColumn, getColumnStatistics, getColumnTypes, getName, getRecord, getRow, getRowStatistics, getStatistics, isColumnNumeric, iterator, removeDataListener
-
-
-
-
Constructor Detail
-
Median
public Median(DataSource original, int windowSize, int offset, Filter2D.Mode mode, int... cols)
Creates a new Median object with the specified DataSource, window size, offset, Mode, and columns.- Parameters:
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.
-
-
Method Detail
-
getWindowSize
public int getWindowSize()
Returns the size of the window which is used to calculate the median.- Returns:
- Number of rows used.
-
setWindowSize
public void setWindowSize(int windowSize)
Set the size of the window which is used to calculate the median.- Parameters:
windowSize- Number of rows used.
-
getOffset
public int getOffset()
Returns the offset from the current value used to calculate the median to the last value of the window.- Returns:
- Offset.
-
setOffset
public void setOffset(int offset)
Sets the offset from the current value used to calculate the median to the last value of the window.- Parameters:
offset- Offset.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG