package net.heartshield.filter;

import net.heartshield.signal.DVec;


/**
 * Filter block accepting data and storing it into an array.
 *
 * @author David Madl (git@abanbytes.eu)
 * @date 2017-03-26
 */
public class DataSink extends SinkBlock {
    private double[] mData;

    public DataSink() {
        mData = new double[0];
    }

    public double[] getData() {
        return mData;
    }

    @Override
    public void put(double[] x) {
        mData = DVec.stack(mData, x);
    }

    @Override
    protected double[] batch(double[] x) {
        throw new IllegalStateException("should not call batch() here");
    }
}
