package leigh.m3;

import java.util.ArrayList;
import java.util.Objects;

public class StreamWindow {
    private final int pastDiscos;
    private final ArrayList<SegmentSchedule> window;

    public StreamWindow(int pastDiscos, ArrayList<SegmentSchedule> window) {
        this.pastDiscos = pastDiscos;
        this.window = window;
    }

    public int getLowSequence() {
        return window.get(0).getSequenceNumber();
    }

    public int getPastDiscos() {
        return pastDiscos;
    }

    public ArrayList<SegmentSchedule> getWindow() {
        return window;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        StreamWindow that = (StreamWindow) o;
        return pastDiscos == that.pastDiscos && Objects.equals(window, that.window);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pastDiscos, window);
    }

    @Override
    public String toString() {
        return "StreamWindow{" +
                "pastDiscos=" + pastDiscos +
                ", window=" + window +
                '}';
    }
}
