Class Region


  • class Region
    extends java.lang.Object
    Region of the result that still needs to be computed.

    Regions are held in a singly-linked-list by Candidate using the Candidate.regionList field. The list is kept in sorted order by resultStart.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int length
      Length of the region, always >= 1.
      (package private) Region next
      Next entry in the region linked list.
      (package private) int resultStart
      First position of this region in the result file blame is computing.
      (package private) int sourceStart
      First position in the Candidate that owns this Region.
    • Constructor Summary

      Constructors 
      Constructor Description
      Region​(int rs, int ss, int len)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) Region copy​(int newSource)
      Copy the entire result region, but at a new source position.
      (package private) Region deepCopy()  
      (package private) void slideAndShrink​(int d)
      Edit this region to remove the first d elements.
      (package private) Region splitFirst​(int newSource, int newLen)
      Split the region, assigning a new source position to the first half.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • next

        Region next
        Next entry in the region linked list.
      • resultStart

        int resultStart
        First position of this region in the result file blame is computing.
      • sourceStart

        int sourceStart
        First position in the Candidate that owns this Region.
      • length

        int length
        Length of the region, always >= 1.
    • Constructor Detail

      • Region

        Region​(int rs,
               int ss,
               int len)
    • Method Detail

      • copy

        Region copy​(int newSource)
        Copy the entire result region, but at a new source position.
        Parameters:
        newSource - the new source position.
        Returns:
        the same result region, but offset for a new source.
      • splitFirst

        Region splitFirst​(int newSource,
                          int newLen)
        Split the region, assigning a new source position to the first half.
        Parameters:
        newSource - the new source position.
        newLen - length of the new region.
        Returns:
        the first half of the region, at the new source.
      • slideAndShrink

        void slideAndShrink​(int d)
        Edit this region to remove the first d elements.
        Parameters:
        d - number of elements to remove from the start of this region.
      • toString

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