Documentation of 'edu.rit.util.Sorting' Java class
Sorting
edu.rit.util

Class Sorting



  • public class Sorting
    extends java.lang.Object
    Class Sorting provides static methods for sorting arrays of primitive types and object types.

    Note: The operations in class Sorting are not multiple thread safe.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  Sorting.Byte
      Class Sorting.Byte is the base class for a helper object used to sort an array of type byte[].
      static class  Sorting.Character
      Class Sorting.Character is the base class for a helper object used to sort an array of type char[].
      static class  Sorting.Double
      Class Sorting.Double is the base class for a helper object used to sort an array of type double[].
      static class  Sorting.Float
      Class Sorting.Float is the base class for a helper object used to sort an array of type float[].
      static class  Sorting.Integer
      Class Sorting.Integer is the base class for a helper object used to sort an array of type int[].
      static class  Sorting.Long
      Class Sorting.Long is the base class for a helper object used to sort an array of type long[].
      static class  Sorting.Object<T>
      Class Sorting.Object is the abstract base class for a helper object used to sort an array of objects of type T[].
      static class  Sorting.Short
      Class Sorting.Short is the base class for a helper object used to sort an array of type short[].
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static byte[] sort(byte[] x, Sorting.Byte helper)
      Sort the given array of type byte[].
      static char[] sort(char[] x, Sorting.Character helper)
      Sort the given array of type char[].
      static double[] sort(double[] x, Sorting.Double helper)
      Sort the given array of type double[].
      static float[] sort(float[] x, Sorting.Float helper)
      Sort the given array of type float[].
      static int[] sort(int[] x, Sorting.Integer helper)
      Sort the given array of type int[].
      static long[] sort(long[] x, Sorting.Long helper)
      Sort the given array of type long[].
      static short[] sort(short[] x, Sorting.Short helper)
      Sort the given array of type short[].
      static <T> T[] sort(T[] x, Sorting.Object<T> helper)
      Sort the given object array of type T[].
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • sort

        public static byte[] sort(byte[] x,
                                  Sorting.Byte helper)
        Sort the given array of type byte[]. The given helper object is used to determine the desired ordering of the array elements and to swap the array elements. An O(n log n) heapsort algorithm is used.
        Parameters:
        x - Array to be sorted.
        helper - Helper object.
        Returns:
        The array that was sorted (x).
      • sort

        public static char[] sort(char[] x,
                                  Sorting.Character helper)
        Sort the given array of type char[]. The given helper object is used to determine the desired ordering of the array elements and to swap the array elements. An O(n log n) heapsort algorithm is used.
        Parameters:
        x - Array to be sorted.
        helper - Helper object.
        Returns:
        The array that was sorted (x).
      • sort

        public static short[] sort(short[] x,
                                   Sorting.Short helper)
        Sort the given array of type short[]. The given helper object is used to determine the desired ordering of the array elements and to swap the array elements. An O(n log n) heapsort algorithm is used.
        Parameters:
        x - Array to be sorted.
        helper - Helper object.
        Returns:
        The array that was sorted (x).
      • sort

        public static int[] sort(int[] x,
                                 Sorting.Integer helper)
        Sort the given array of type int[]. The given helper object is used to determine the desired ordering of the array elements and to swap the array elements. An O(n log n) heapsort algorithm is used.
        Parameters:
        x - Array to be sorted.
        helper - Helper object.
        Returns:
        The array that was sorted (x).
      • sort

        public static long[] sort(long[] x,
                                  Sorting.Long helper)
        Sort the given array of type long[]. The given helper object is used to determine the desired ordering of the array elements and to swap the array elements. An O(n log n) heapsort algorithm is used.
        Parameters:
        x - Array to be sorted.
        helper - Helper object.
        Returns:
        The array that was sorted (x).
      • sort

        public static float[] sort(float[] x,
                                   Sorting.Float helper)
        Sort the given array of type float[]. The given helper object is used to determine the desired ordering of the array elements and to swap the array elements. An O(n log n) heapsort algorithm is used.
        Parameters:
        x - Array to be sorted.
        helper - Helper object.
        Returns:
        The array that was sorted (x).
      • sort

        public static double[] sort(double[] x,
                                    Sorting.Double helper)
        Sort the given array of type double[]. The given helper object is used to determine the desired ordering of the array elements and to swap the array elements. An O(n log n) heapsort algorithm is used.
        Parameters:
        x - Array to be sorted.
        helper - Helper object.
        Returns:
        The array that was sorted (x).
      • sort

        public static <T> T[] sort(T[] x,
                                   Sorting.Object<T> helper)
        Sort the given object array of type T[]. The given helper object is used to determine the desired ordering of the array elements and to swap the array elements. An O(n log n) heapsort algorithm is used.
        Type Parameters:
        T - Data type of the array elements.
        Parameters:
        x - Array to be sorted.
        helper - Helper object.
        Returns:
        The array that was sorted (x).

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.