Class CompactLocationNumbering


  • public class CompactLocationNumbering
    extends java.lang.Object
    Compute a compact numbering of Locations in a CFG. This is useful for analyses that want to use a BitSet to keep track of Locations.
    Author:
    David Hovemeyer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Location getLocation​(int number)
      Get the Location given its number.
      int getNumber​(Location location)
      Get the number of given Location, which will be a non-negative integer in the range 0..getSize() - 1.
      int getSize()
      Get the size of the numbering, which is the maximum number assigned plus one.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompactLocationNumbering

        public CompactLocationNumbering​(CFG cfg)
        Constructor.
        Parameters:
        cfg - the CFG containing the Locations to number
    • Method Detail

      • getSize

        public int getSize()
        Get the size of the numbering, which is the maximum number assigned plus one.
        Returns:
        the maximum number assigned plus one
      • getNumber

        public int getNumber​(Location location)
        Get the number of given Location, which will be a non-negative integer in the range 0..getSize() - 1.
        Parameters:
        location -
        Returns:
        the number of the location
      • getLocation

        public Location getLocation​(int number)
        Get the Location given its number.
        Parameters:
        number - the number
        Returns:
        Location corresponding to that number