package time;

public abstract class View<T> {
    protected View<T> next = null;

    public View<T> then(View<T> next) {
        this.next = next;
        return this;
    }

    protected abstract T[] transform(T [] input);

    public T[] view(T[] input) {
        return (next != null)
          ? next.view(transform(input))
          : transform(input);
    }
}
