de.erichseifert.gral.data.filters
Class Median

java.lang.Object
  extended by de.erichseifert.gral.data.AbstractDataSource
      extended by de.erichseifert.gral.data.filters.Filter
          extended by de.erichseifert.gral.data.filters.Median
All Implemented Interfaces:
DataListener, DataSource, Iterable<Number>

public class Median
extends Filter

Class that calculates the median of a data sequence

.


Nested Class Summary
 
Nested classes/interfaces inherited from class de.erichseifert.gral.data.filters.Filter
Filter.Mode
 
Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class de.erichseifert.gral.data.filters.Filter
dataChanged, get, getColumnCount, getMode, getRowCount, setMode
 
Methods inherited from class de.erichseifert.gral.data.AbstractDataSource
addDataListener, getColumn, getRow, getStatistics, iterator, removeDataListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Median

public 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.

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.


Copyright © 2009-2010. All Rights Reserved.