Class PivotLocation

java.lang.Object
sort.core.quick.PivotLocation

public final class PivotLocation
extends java.lang.Object
A location where an array has been partitioned. Because the partition location can be a range (if there are multiple values in the array that are equal to the partition value), the partition location is represented with two values: the left side of the upper range (inclusive) and the right side of the lower range (inclusive).
Author:
Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
  • Constructor Summary

    Constructors 
    Constructor Description
    PivotLocation​(int leftSidesUpperExclusive, int rightSidesLowerInclusive)  
  • Method Summary

    Modifier and Type Method Description
    int getLeftSidesUpperExclusive()
    Gets the index of the maximum value in the partitioned array that is less than the partition value.
    int getRightSidesLowerInclusive()
    Gets the index of the minimum value in the partitioned array that is greater than the partition value.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PivotLocation

      public PivotLocation​(int leftSidesUpperExclusive, int rightSidesLowerInclusive)
  • Method Details

    • getLeftSidesUpperExclusive

      public int getLeftSidesUpperExclusive()
      Gets the index of the maximum value in the partitioned array that is less than the partition value. You can think of this as the right side of the lower range of the array.
      Returns:
      the maximum index (exclusive) of the range left of the pivot
    • getRightSidesLowerInclusive

      public int getRightSidesLowerInclusive()
      Gets the index of the minimum value in the partitioned array that is greater than the partition value. You can think of this as the left side of the upper range of the array.
      Returns:
      the minimum index (inclusive) of the range right of the pivot
    • toString

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