Class Utils

java.lang.Object
parser.methods.ext.Utils

public final class Utils extends Object
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • stringsToBigDecimals

      public static List<BigDecimal> stringsToBigDecimals(List<String> tokens)
      Converts list of strings to list of big decimals
    • stringsToBigDecimals

      public static List<BigDecimal> stringsToBigDecimals(List<String> tokens, int headCut)
      Converts list of strings to list of big decimals, and custs first
      Parameters:
      headCut - members to cut of frombthebegining
    • trimList

      public static List<?> trimList(List<?> tokens, int toRemove, int minLength)
      Will remove toRemove elements from BOTH sides of tokens, leaving at least minLength of elements in place. It always take from both sides, or nto at all
    • sum

      public static BigDecimal sum(List<BigDecimal> l)
      Returns:
      the sum of all elements in the data set with BigDecimal precission
    • gsum

      public static BigDecimal gsum(List<BigDecimal> l)
      Returns:
      the geomethrical (multiplied) sum of all elements in the data set
    • getFirstTokenAsInt

      public static int getFirstTokenAsInt(List<String> tokens)