// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.Arrays;
import java.util.Comparator;

public class TwoDimSort {
    private static Object[][] rows = new Object[][] {
            { 1, "Fil01", 213123123.0 },
            { 2, "Fil02", 123123123.0 },
            { 3, "Fil03", 324234234.0 },
            { 4, "Fil03", 234809238.0 },
            { 5, "Fil04", 098374932.0 },
            { 20, "Fil05", 123987928.0 },
            { 7, "Fil06", 979872398.0 },
            { 8, "Fil07", 234920384.0 },
            { 9, "Fil08", 324879283.0 },
            { 10, "Fil09", 347238923.0 } };
    public static void main(String[] args) {
        System.out.println("Before:");
        for (int i = 0; i < rows.length; i++) {
            for (int j = 0; j < rows[i].length; j++) {
                System.out.print(" " + rows[i][j]);
            }
            System.out.println();
        }
        Arrays.sort(rows, new Cmp());
        System.out.println("After:");
        for (int i = 0; i < rows.length; i++) {
            for (int j = 0; j < rows[i].length; j++) {
                System.out.print(" " + rows[i][j]);
            }
            System.out.println();
        }
    }
}

class Cmp implements Comparator<Object[]> {
    public int compare(Object[] o1, Object[] o2) {
        return (int)((Double)o1[2] - (Double)o2[2]);
    }
}
