public int compareRights(RowSegment<E> other) {
		// first, just check the rows of this segment and the other, if the rows are
		// not the same, then one column clearly above the other.
		int result = getRow() - other.getRow();
		if (result != 0) {
			return result;
		}

		// We are in the same grid row, so the order is determined by the segment at the
		// right of the column. There are 2 possible orientations for the right column. 1) it can
		// extend upwards from our row, or it can extend downwards from our row.
		// If our right orientation is not the same as the other row segment, the order is
		// simply UP < DOWN in order to reduce edge crossings. Edges on the top
		// go up and edges on the bottom go down, so they won't cross each other.

		ColumnOrientation myRightColOrientation = getOrientationForRightColumn();
		ColumnOrientation otherRightColOrientation = other.getOrientationForRightColumn();

		// if they are not the same, then UP < DOWN
		if (myRightColOrientation != otherRightColOrientation) {
			return myRightColOrientation.compareTo(otherRightColOrientation);
		}

		// Both this segment's right column and the other segment's right column have the same
		// orientation. Compare the right column segments and use those results to determine our
		// ordering top to bottom. If the right columns extend upward, then which ever column is
		// left most (lower value), should have it's associated row higher spatially (lower row
		// value). Keeping left most columns(lower value) as higher rows (lower values) allows
		// their shape to avoid being crossed by the wider shape, which will be lower.
		// 
		// And if the right rows extends downwards, the inverse applies.	
		ColumnSegment<E> myRightColSegment = getRightColSegment();
		ColumnSegment<E> otherRightColSegment = other.getRightColSegment();

		if (myRightColOrientation == ColumnOrientation.UP) {
			return myRightColSegment.compareTops(otherRightColSegment);
		}
		return -myRightColSegment.compareBottoms(otherRightColSegment);
	}
Compares row segments strictly based  on the relationship of the connected column segments 
at the right of these segments. 
@param other the other row segment to compare
@return  a negative integer, zero, or a positive integer as this object
         is less than, equal to, or greater than the specified object.
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/layout/flowchart/RowSegment.java