private int compare(int position, Block[] blocks, Block[] currentMax)
{
for (int i = 0; i < sortChannels.size(); i++) {
Type type = sortTypes.get(i);
int sortChannel = sortChannels.get(i);
SortOrder sortOrder = sortOrders.get(i);
Block block = blocks[sortChannel];
Block currentMaxValue = currentMax[sortChannel];
// compare the right value to the left block but negate the result since we are evaluating in the opposite order
int compare = -sortOrder.compareBlockValue(type, currentMaxValue, 0, block, position);
if (compare != 0) {
return compare;
}
}
return 0;