Class Edge

    • Constructor Detail

      • Edge

        protected Edge()
        Builds an "empty" edge, meaning that it does not have endpoints.
      • Edge

        protected Edge​(Statement source,
                       Statement destination)
        Builds the edge.
        Parameters:
        source - the source statement
        destination - the destination statement
    • Method Detail

      • getSource

        public final Statement getSource()
        Description copied from interface: Edge
        Yields the node where this edge originates.
        Specified by:
        getSource in interface Edge<CFG,​Statement,​Edge>
        Returns:
        the source node
      • getDestination

        public final Statement getDestination()
        Description copied from interface: Edge
        Yields the node where this edge ends.
        Specified by:
        getDestination in interface Edge<CFG,​Statement,​Edge>
        Returns:
        the destination node
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public abstract java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • traverseForward

        public abstract <A extends AbstractState<A>> AnalysisState<A> traverseForward​(AnalysisState<A> state)
                                                                               throws SemanticException
        Traverses this edge in the forward direction, proceeding from source to destination, optionally modifying the given sourceState by applying semantic assumptions.
        Type Parameters:
        A - the concrete AbstractState instance
        Parameters:
        state - the AnalysisState computed at the source of this edge
        Returns:
        the AnalysisState after traversing this edge
        Throws:
        SemanticException - if something goes wrong during the computation
      • traverseBackwards

        public abstract <A extends AbstractState<A>> AnalysisState<A> traverseBackwards​(AnalysisState<A> state)
                                                                                 throws SemanticException
        Traverses this edge in the backward direction, from destination to source, optionally modifying the given sourceState by applying semantic assumptions.
        Type Parameters:
        A - the concrete AbstractState instance
        Parameters:
        state - the AnalysisState computed at the destination of this edge
        Returns:
        the AnalysisState after traversing this edge
        Throws:
        SemanticException - if something goes wrong during the computation
      • accept

        public <V> boolean accept​(GraphVisitor<CFG,​Statement,​Edge,​V> visitor,
                                  V tool)
        Description copied from interface: Edge
        Accepts the given GraphVisitor. Implementors of this method are responsible for invoking GraphVisitor.visit(Object, Graph, Edge) on this edge. The visiting should stop if such call returns false.
        Specified by:
        accept in interface Edge<CFG,​Statement,​Edge>
        Type Parameters:
        V - the type of auxiliary tool that visitor can use
        Parameters:
        visitor - the visitor that is visiting the Graph containing this edge
        tool - the auxiliary tool that visitor can use
        Returns:
        whether or not the visiting should stop when this call returns, as decided by the visitor itself
      • compareTo

        public int compareTo​(Edge o)
        Specified by:
        compareTo in interface java.lang.Comparable<Edge>