package net.heartshield.filter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author David Madl (git@abanbytes.eu)
 * @date 2017-05-16
 */
public class Splitter implements IRFilterBlock {
    protected List<IRFilterBlock> mConsumers = new ArrayList<>();

    public void connect(IRFilterBlock consumer) {
        mConsumers.add(consumer);
    }

    /** batch-add an array and push results through consumers */
    @Override
    public void put(double[] x) {
        for(IRFilterBlock consumer : mConsumers)
            consumer.put(x);
    }
}
