Enum CollectionUtils

    • Method Summary

      Methods

      Modifier and Type Method and Description
      static boolean isEmpty(Object[] array)
      Checks if the given array contains any elements.
      static <T> List<T> rotate(List<T> list, int distance)
      Return a rotated view of the given list with the given distance.
      static void sort(<any> array)
       
      static void sort(org.apache.lucene.util.BytesRefArray bytes, int[] indices)
       
      static void sort(double[] array, int len)
       
      static void sort(DoubleArrayList list)
       
      static void sort(float[] array, int len)
       
      static void sort(FloatArrayList list)
       
      static void sort(long[] array, int len)
       
      static void sort(LongArrayList list)
       
      static void sortAndDedup(<any> array)
       
      static int sortAndDedup(org.apache.lucene.util.BytesRefArray bytes, int[] indices)
       
      static int sortAndDedup(double[] array, int len)
      Sort and deduplicate values in-place, then return the unique element count.
      static void sortAndDedup(DoubleArrayList list)
       
      static int sortAndDedup(float[] array, int len)
      Sort and deduplicate values in-place, then return the unique element count.
      static void sortAndDedup(FloatArrayList list)
       
      static int sortAndDedup(long[] array, int len)
      Sort and deduplicate values in-place, then return the unique element count.
      static void sortAndDedup(LongArrayList list)
       
      static CollectionUtils valueOf(String name)
      Returns the enum constant of this type with the specified name.
      static CollectionUtils[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
    • Method Detail

      • values

        public static CollectionUtils[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CollectionUtils c : CollectionUtils.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CollectionUtils valueOf(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • sort

        public static void sort(LongArrayList list)
      • sort

        public static void sort(long[] array,
                                int len)
      • sortAndDedup

        public static void sortAndDedup(LongArrayList list)
      • sortAndDedup

        public static int sortAndDedup(long[] array,
                                       int len)
        Sort and deduplicate values in-place, then return the unique element count.
      • sort

        public static void sort(FloatArrayList list)
      • sort

        public static void sort(float[] array,
                                int len)
      • sortAndDedup

        public static void sortAndDedup(FloatArrayList list)
      • sortAndDedup

        public static int sortAndDedup(float[] array,
                                       int len)
        Sort and deduplicate values in-place, then return the unique element count.
      • sort

        public static void sort(DoubleArrayList list)
      • sort

        public static void sort(double[] array,
                                int len)
      • sortAndDedup

        public static void sortAndDedup(DoubleArrayList list)
      • sortAndDedup

        public static int sortAndDedup(double[] array,
                                       int len)
        Sort and deduplicate values in-place, then return the unique element count.
      • isEmpty

        public static boolean isEmpty(Object[] array)
        Checks if the given array contains any elements.
        Parameters:
        array - The array to check
        Returns:
        false if the array contains an element, true if not or the array is null.
      • rotate

        public static <T> List<T> rotate(List<T> list,
                                         int distance)
        Return a rotated view of the given list with the given distance.
      • sortAndDedup

        public static void sortAndDedup(<any> array)
      • sort

        public static void sort(<any> array)
      • sort

        public static void sort(org.apache.lucene.util.BytesRefArray bytes,
                                int[] indices)
      • sortAndDedup

        public static int sortAndDedup(org.apache.lucene.util.BytesRefArray bytes,
                                       int[] indices)