Java Array Sort copyAndSort(String[] input)

Here you can find the source of copyAndSort(String[] input)

Description

Copy an sort the input array.

License

Open Source License

Parameter

Parameter Description
input to sort

Return

sorted copied array

Declaration

protected static String[] copyAndSort(String[] input) 

Method Source Code

//package com.java2s;
/**************************************************************************************
 * Copyright (C) 2008 EsperTech, Inc. All rights reserved.                            *
 * http://esper.codehaus.org                                                          *
 * http://www.espertech.com                                                           *
 * ---------------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the GPL license       *
 * a copy of which has been included with this distribution in the license.txt file.  *
 **************************************************************************************/

import java.util.*;

public class Main {
    /**/*from  ww  w .j a  v a  2 s . c o  m*/
     * Copy an sort the input array.
     * @param input to sort
     * @return sorted copied array
     */
    protected static String[] copyAndSort(String[] input) {
        String[] result = new String[input.length];
        System.arraycopy(input, 0, result, 0, input.length);
        Arrays.sort(result);
        return result;
    }
}

Related

  1. addSortedUnique(T[] array, T object, int start)
  2. addToSortedIntArray(int[] a, int value)
  3. bitReversalSort(final short[] real)
  4. calculatePValueForDataPoint(double dataPoint, double[] sortedNullHypothesisSample)
  5. collectionToSortedArray(Collection objects)
  6. copyAndSort(T[] builtinFunctions)
  7. copySortArray(String[] values)
  8. countingSort(int[] a, int low, int high)
  9. countingSort(int[] array, int low, int high)