Package edu.umd.cs.findbugs.ba
Class Edge
- java.lang.Object
-
- edu.umd.cs.findbugs.graph.AbstractEdge<Edge,BasicBlock>
-
- edu.umd.cs.findbugs.ba.Edge
-
- All Implemented Interfaces:
Debug,EdgeTypes,GraphEdge<Edge,BasicBlock>,java.lang.Comparable<Edge>
public class Edge extends AbstractEdge<Edge,BasicBlock> implements EdgeTypes, Debug
An edge of a control flow graph.- Author:
- David Hovemeyer
- See Also:
BasicBlock,CFG
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEdge.Type
-
Field Summary
-
Fields inherited from interface edu.umd.cs.findbugs.ba.Debug
VERIFY_INTEGRITY
-
Fields inherited from interface edu.umd.cs.findbugs.ba.EdgeTypes
BACKEDGE_SOURCE_EDGE, BACKEDGE_TARGET_EDGE, CHECKED_EXCEPTIONS_FLAG, EXIT_EDGE, EXPLICIT_EXCEPTIONS_FLAG, FALL_THROUGH_EDGE, GOTO_EDGE, HANDLED_EXCEPTION_EDGE, IFCMP_EDGE, JSR_EDGE, RET_EDGE, RETURN_EDGE, START_EDGE, SWITCH_DEFAULT_EDGE, SWITCH_EDGE, UNHANDLED_EXCEPTION_EDGE, UNKNOWN_EDGE
-
-
Constructor Summary
Constructors Constructor Description Edge(BasicBlock source, BasicBlock dest)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Edge other)Compare with other edge.static java.lang.StringedgeTypeToString(int edgeType)Get string representing given edge type.booleanequals(java.lang.Object o)java.lang.StringformatAsString(boolean reverse)Return a string representation of the edge.intgetFlags()Get the edge flags.intgetId()intgetType()Get the type of edge.inthashCode()booleanisBackwardInBytecode()booleanisExceptionEdge()Is the edge an exception edge?booleanisFlagSet(int flag)Return if given edge flag is set.voidsetFlags(int flags)Set the edge flags.voidsetType(int type)Set the type of edge.booleansourceIsTopOfLoop(java.util.Set<java.lang.Integer> positions)static intstringToEdgeType(java.lang.String s)Get numeric edge type from string representation.java.lang.StringtoString()-
Methods inherited from class edu.umd.cs.findbugs.graph.AbstractEdge
getLabel, getSource, getTarget, setLabel
-
-
-
-
Constructor Detail
-
Edge
public Edge(BasicBlock source, BasicBlock dest)
Constructor.- Parameters:
source- source basic blockdest- destination basic block
-
-
Method Detail
-
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(java.lang.Object o)
- Overrides:
equalsin classAbstractEdge<Edge,BasicBlock>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractEdge<Edge,BasicBlock>
-
compareTo
public int compareTo(Edge other)
Compare with other edge.- Specified by:
compareToin interfacejava.lang.Comparable<Edge>- Overrides:
compareToin classAbstractEdge<Edge,BasicBlock>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isBackwardInBytecode
public boolean isBackwardInBytecode()
-
sourceIsTopOfLoop
public boolean sourceIsTopOfLoop(@Nonnull java.util.Set<java.lang.Integer> positions)
-
formatAsString
public java.lang.String formatAsString(boolean reverse)
Return a string representation of the edge.
-
edgeTypeToString
public static java.lang.String edgeTypeToString(@Type int edgeType)
Get string representing given edge type.
-
stringToEdgeType
@Type public static int stringToEdgeType(java.lang.String s)
Get numeric edge type from string representation.
-
-