Class CollectionUtils


  • public final class CollectionUtils
    extends Object
    Contains some useful utility methods for working with Collections.
    Author:
    Jon, Guy
    • Method Detail

      • listFromFloatArray

        public static List<Float> listFromFloatArray​(float[] arr)
        Creates and returns an unmodifiable List that wraps the given array. Changes to the array will be reflected in the List.
        Parameters:
        arr - The array to wrap as a List
        Returns:
        an unmodifiable List that wraps the array
        Throws:
        NullPointerException - if the array is null
      • listFromDoubleArray

        public static List<Double> listFromDoubleArray​(double[] arr)
        Creates and returns an unmodifiable List that wraps the given array. Changes to the array will be reflected in the List.
        Parameters:
        arr - The array to wrap as a List
        Returns:
        an unmodifiable List that wraps the array
        Throws:
        NullPointerException - if the array is null