package accrue.analysis.interprocanalysis;

public class EdgeIdentifier_c implements EdgeIdentifier {
    protected final EdgeType key;
    protected final NodeIdentifier target;

    public EdgeIdentifier_c(EdgeType key, NodeIdentifier target) {
        this.key = key;
        this.target = target;
    }

    @Override
    public EdgeType getKey() {
        return key;
    }

    @Override
    public NodeIdentifier getTarget() {
        return target;
    }

    @Override
    public String toString() {
        return "(" + key + ") " + target;
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof EdgeIdentifier_c) {
            EdgeIdentifier_c that = (EdgeIdentifier_c) o;
            return this.key.equals(that.key) && this.target.equals(that.target);
        }
        return false;
    }

    @Override
    public int hashCode() {
        return key.hashCode() ^ target.hashCode();
    }
}
