private void medianRank(int rankValue, boolean downwardSweep) {
int numCellsForRank = nestedBestRanks[rankValue].length;
MedianCellSorter[] medianValues = new MedianCellSorter[numCellsForRank];
for (int i = 0; i < numCellsForRank; i++) {
JGraphAbstractHierarchyCell cell = (JGraphAbstractHierarchyCell) nestedBestRanks[rankValue][i];
medianValues[i] = new MedianCellSorter();
medianValues[i].cell = cell;
// Flip whether or not equal medians are flipped on up and down
// sweeps
medianValues[i].nudge = !downwardSweep;
Collection nextLevelConnectedCells;
if (downwardSweep) {
nextLevelConnectedCells = cell
.getNextLayerConnectedCells(rankValue);
} else {
nextLevelConnectedCells = cell
.getPreviousLayerConnectedCells(rankValue);
}
int nextRankValue;
if (downwardSweep) {
nextRankValue = rankValue + 1;