Newer
Older
public abstract class Arc<D extends ArcData> extends edg.graphlib.Arrow<String, D> {
@SuppressWarnings("unchecked")
super((edg.graphlib.Vertex<String, D>) from, (edg.graphlib.Vertex<String, D>) to);
}
/** @see tfm.arcs.cfg.ControlFlowArc.NonExecutable */
public abstract boolean isExecutableControlFlowArrow();
/** @see tfm.arcs.pdg.ControlDependencyArc */
/** @see tfm.arcs.pdg.DataDependencyArc */
public abstract boolean isDataDependencyArrow();
@Override
public String toString() {
return String.format("Arc{data: %s, %s -> %s}",
getData(),
getFrom(),
getTo()
);
}
public String toGraphvizRepresentation() {
GraphNode<?> from = (GraphNode<?>) getFrom();
GraphNode<?> to = (GraphNode<?>) getTo();
return String.format("%s -> %s",
from.getId(),
to.getId()
);
public GraphNode<?> getFromNode() {
return (GraphNode<?>) super.getFrom();
public GraphNode<?> getToNode() {
return (GraphNode<?>) super.getTo();
@Override
public int hashCode() {
return Objects.hashCode(getData()) + getFrom().hashCode() + getTo().hashCode();
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof Arc))
return false;
GraphNode<?> from = (GraphNode<?>) arc.getFrom();
GraphNode<?> from2 = (GraphNode<?>) getFrom();
GraphNode<?> to = (GraphNode<?>) getTo();
GraphNode<?> to2 = (GraphNode<?>) arc.getTo();
return Objects.equals(arc.getData(), getData()) &&
Objects.equals(from.getId(), from2.getId()) &&
Objects.equals(to.getId(), to2.getId());