All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.qbicc.graph.Unreachable Maven / Gradle / Ivy

There is a newer version: 0.77.0
Show newest version
package org.qbicc.graph;

import java.util.Objects;

import org.qbicc.type.definition.element.ExecutableElement;

public class Unreachable extends AbstractTerminator implements Terminator {
    private final Node dependency;
    private final BasicBlock terminatedBlock;

    Unreachable(final Node callSite, final ExecutableElement element, final int line, final int bci, final BlockEntry blockEntry, Node dependency) {
        super(callSite, element, line, bci);
        this.dependency = dependency;
        terminatedBlock = new BasicBlock(blockEntry, this);
    }

    public BasicBlock getTerminatedBlock() {
        return terminatedBlock;
    }

    @Override
    public Node getDependency() {
        return dependency;
    }

    public  R accept(final TerminatorVisitor visitor, final T param) {
        return visitor.visit(param, this);
    }

    int calcHashCode() {
        return Objects.hash(Unreachable.class, dependency);
    }

    @Override
    String getNodeName() {
        return "Unreachable";
    }

    public boolean equals(final Object other) {
        return other instanceof Unreachable && equals((Unreachable) other);
    }

    public boolean equals(final Unreachable other) {
        return this == other || other != null
                && dependency.equals(other.dependency);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy