Pads data to left and/or right.:

Let l be the index of the first non-zero element in data (for left padding),let r be the index of the last non-zero element in data (for right padding) then for every element e which index is i such that: 0 , e is replaced with arithmetic mean of data[l]..data[l + window_length/2 - 1] (left padding)r , e is replaced with arithmetic mean of data[r - window_length/2 + 1]..data[r] (right padding)

Example:

Given data: [0,0,0,1,2,1,3,1,2,4,0] result of applying MeanValuePadder with MeanValuePadder.WindowLength = 4 is: [1.5,1.5,1.5,1,2,1,3,1,2,4,0] in case of {@link #isPaddingLeft() left padding}; [0,0,0,1,2,1,3,1,2,4,3] in case of MeanValuePadder.PaddingRight;

@author Marcin Rzeźnicki