package pathgame.algorithm;

public class TreeEdge implements Comparable< TreeEdge > {
    private int src, dest, weight;
    private boolean checked = false;

    public TreeEdge(int src, int dest, int weight) {
        this.src = src;
        this.dest = dest;
        this.weight = weight;
    }

    public int getSrc() {
        return src;
    }

    public int getDest() {
        return dest;
    }

    public int getOtherVertex(int other) {
        if(other == src) {
            return dest;
        }
        else  {
            return src;
        }
    }

    public Integer getWeight() {
        return weight;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    @Override
    public int compareTo(TreeEdge o) {
        return this.getWeight().compareTo(o.getWeight());
    }
}
