Class Edge

All Implemented Interfaces:
Debug, EdgeTypes, GraphEdge<Edge,BasicBlock>, Comparable<Edge>

public class Edge extends AbstractEdge<Edge,BasicBlock> implements EdgeTypes, Debug
An edge of a control flow graph.
Author:
David Hovemeyer
See Also:
  • Constructor Details

    • Edge

      public Edge(BasicBlock source, BasicBlock dest)
      Constructor.
      Parameters:
      source - source basic block
      dest - destination basic block
  • Method Details

    • getId

      public int getId()
    • getType

      @Type public int getType()
      Get the type of edge.
    • setType

      public void setType(@Type int type)
      Set the type of edge.
    • getFlags

      public int getFlags()
      Get the edge flags.
    • setFlags

      public void setFlags(int flags)
      Set the edge flags.
    • isFlagSet

      public boolean isFlagSet(int flag)
      Return if given edge flag is set.
      Parameters:
      flag - the edge flag
      Returns:
      true if the flag is set, false otherwise
    • isExceptionEdge

      public boolean isExceptionEdge()
      Is the edge an exception edge?
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractEdge<Edge,BasicBlock>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractEdge<Edge,BasicBlock>
    • compareTo

      public int compareTo(Edge other)
      Compare with other edge.
      Specified by:
      compareTo in interface Comparable<Edge>
      Overrides:
      compareTo in class AbstractEdge<Edge,BasicBlock>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isBackwardInBytecode

      public boolean isBackwardInBytecode()
    • sourceIsTopOfLoop

      public boolean sourceIsTopOfLoop(@Nonnull Set<Integer> positions)
    • formatAsString

      public String formatAsString(boolean reverse)
      Return a string representation of the edge.
    • edgeTypeToString

      public static String edgeTypeToString(@Type int edgeType)
      Get string representing given edge type.
    • stringToEdgeType

      @Type public static int stringToEdgeType(String s)
      Get numeric edge type from string representation.