Class CollectionTools


  • public class CollectionTools
    extends Object
    • Constructor Detail

      • CollectionTools

        public CollectionTools()
    • Method Detail

      • asList

        public static List<Integer> asList​(int[] elements)
      • shuffle

        public static int[] shuffle​(int[] elements)
      • toIntArray

        public static int[] toIntArray​(List<Integer> list)
      • roundNonZerosToTarget

        public static double[] roundNonZerosToTarget​(double[] arr,
                                                     double target,
                                                     boolean newZeros,
                                                     int num_decimals)
        Round non zero values such as the sum is equal to the target.
        Parameters:
        arr -
        target -
        num_decimals -
        Returns: