IndexSorter { public static <T> IntSeries sortIndex(Series<T> s, Comparator<? super T> comparator) { int[] mutableIndex = IndexSorter.rowNumberSequence(s.size()); IntComparator intComparator = (i1, i2) -> comparator.compare(s.get(i1), s.get(i2)); IntTimSort.sort(mutableIndex, intComparator); return new IntArraySeries(mutableIndex); } IndexSorter(DataFrame dataFrame);  IndexSorter(DataFrame dataFrame, IntSeries rangeToSort); static IntSeries sortIndex(Series<T> s, Comparator<? super T> comparator); static int[] rowNumberSequence(int h); IntSeries sortIndex(Comparator<RowProxy> comparator); DataFrame sort(Comparator<RowProxy> comparator);  }
@Test public void testSortIndex() { DataFrame df = DataFrame.newFrame("a", "b").foldByRow( 1, "x", 2, "y", 1, "z", 0, "a", 1, "x"); IntSeries sortIndex = new IndexSorter(df).sortIndex(Sorters.sorter(1, true)); new IntSeriesAsserts(sortIndex).expectData(3, 0, 4, 1, 2); }