Class IntegerList

java.lang.Object
com.pnfsoftware.jeb.util.primitives.IntegerList

public class IntegerList extends Object
Utility code for int arrays or Lists of Integers.
  • Constructor Details

    • IntegerList

      public IntegerList()
  • Method Details

    • format

      public static String format(int[][] l)
      Format a two-dimensional int array.
      Parameters:
      l - array to format
      Returns:
      a comma-separated representation of nested arrays
    • format

      public static String format(int[] l)
      Format an int array.
      Parameters:
      l - array to format
      Returns:
      a comma-separated representation of the array
    • format

      public static String format(List<Integer> l)
      Format a list of integers.
      Parameters:
      l - list to format
      Returns:
      a comma-separated representation of the list
    • compareToArray

      public static boolean compareToArray(List<Integer> l, int[] a)
      Compare a list of integers with an int array.
      Parameters:
      l - list to compare
      a - array to compare
      Returns:
      true if both containers have the same values in the same order
    • buildListFromArray

      public static List<Integer> buildListFromArray(int[] a)
      Build a list of integers from an int array.
      Parameters:
      a - source array
      Returns:
      a new list containing the array values
    • buildList

      public static List<Integer> buildList(int... elts)
      Build a list of integers from varargs.
      Parameters:
      elts - values to add
      Returns:
      a new list containing the provided values
    • buildFromArray

      public static List<Integer> buildFromArray(int[] a, List<Integer> l)
      Replace a list's content with the values from an int array.
      Parameters:
      a - source array
      l - destination list
      Returns:
      the destination list