Java Array Sort sortNames(String[] names)

Here you can find the source of sortNames(String[] names)

Description

sort Names

License

Open Source License

Declaration

private static String[] sortNames(String[] names) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static String[] sortNames(String[] names) {
        String[] newOrder = new String[] { "labelx", "labels1", "labels2",
                "labels3" };
        String[] sortedNames = new String[names.length];

        int index = 0;
        for (String newOrderName : newOrder) {
            for (String name : names) {
                if (name.equals(newOrderName)) {
                    sortedNames[index++] = name;
                }//from   www .  j av  a2s  .  c  om
            }
        }
        return sortedNames;
    }
}

Related

  1. sortMinMaxToMax(double[] min, double[] max)
  2. sortMinToMax(double[] v)
  3. sortNames(String[] names)
  4. sortNames(String[] names)
  5. sortNames(String[] names)
  6. sortNullElements(Object[] array)
  7. sortPerm(final int[] w)
  8. sortPermutation(final int[] A)
  9. sortPixels(double[] data, int numPixel)