code: protected int[] sort(final Comparator<Object> comparator, final int col, final boolean ascending) {
  		// We cache the column data to avoid repeated and potentially expensive lookups
  		Object[] columnData = new Object[getRowCount()];
  
  		for (int i = getRowCount() - 1; i >= 0; i--) {
  			columnData[i] = getValueAt(i, col);
  		}
  
  		int[] sortIndices = new int[getRowCount()];
  
  		for (int i = 0; i < sortIndices.length; i++) {
  			sortIndices[i] = i;
  		}
  
  		TableUtil.sortData(columnData, comparator, ascending, 0, columnData.length - 1, sortIndices);
  
  		return sortIndices;
  	}
docs: Calculates the sort order for the data, using the given column and comparator.
  
  @param comparator the comparator to use for sorting
  @param col the column to sort on
  @param ascending true for an ascending sort, false for descending.
  
  @return the row indices in sort order.