sofya.graphs.cfg
Class CFEdge.BranchID

java.lang.Object
  extended by sofya.graphs.cfg.CFEdge.BranchID
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
CFEdge

public static class CFEdge.BranchID
extends java.lang.Object
implements java.lang.Comparable

A branch ID associated with an edge in a CFG.


Constructor Summary
CFEdge.BranchID(int id, SConstants.BranchType type)
          Creates a new branch ID.
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares this branch ID to another branch ID, ordering them by their integer IDs only.
 boolean equals(java.lang.Object obj)
          Compares two branch IDs for equality; only the integer IDs are compared, types are ignored.
 int getID()
          Gets the branch ID.
 SConstants.BranchType getType()
          Gets the nearest branch type.
 int hashCode()
          Returns the hash code for this branch ID, which is simply the integer ID (branch type is not part of the computation).
 java.lang.String toString()
          Gets a string representation of the branch ID, including its nearest branch type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CFEdge.BranchID

public CFEdge.BranchID(int id,
                       SConstants.BranchType type)
Creates a new branch ID.

Parameters:
id - ID of the branch.
type - Nearest type associated with the branch.
Method Detail

getID

public int getID()
Gets the branch ID.


getType

public SConstants.BranchType getType()
Gets the nearest branch type.


equals

public boolean equals(java.lang.Object obj)
Compares two branch IDs for equality; only the integer IDs are compared, types are ignored.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns the hash code for this branch ID, which is simply the integer ID (branch type is not part of the computation).

Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(java.lang.Object obj)
Compares this branch ID to another branch ID, ordering them by their integer IDs only.

Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Gets a string representation of the branch ID, including its nearest branch type.

Overrides:
toString in class java.lang.Object