Package de.tilman_neumann.jml.base
Class BigIntCollectionUtil
- java.lang.Object
-
- de.tilman_neumann.jml.base.BigIntCollectionUtil
-
public class BigIntCollectionUtil extends Object
Utility methods for collections of BigIntegers.- Author:
- Tilman Neumann
-
-
Constructor Summary
Constructors Constructor Description BigIntCollectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigInteger
absSum(Collection<BigInteger> c)
static BigInteger
product(Collection<BigInteger> c)
static ArrayList<BigInteger>
stringToList(String str)
Factory method creating a list of big integers from the given comma-separated string.static BigInteger
sum(Collection<BigInteger> c)
-
-
-
Method Detail
-
stringToList
public static ArrayList<BigInteger> stringToList(String str)
Factory method creating a list of big integers from the given comma-separated string.- Parameters:
str
-- Returns:
- list of big integers
-
sum
public static BigInteger sum(Collection<BigInteger> c)
- Parameters:
c
- a collection of BigIntegers- Returns:
- The sum of all elements of collection c.
-
absSum
public static BigInteger absSum(Collection<BigInteger> c)
- Parameters:
c
- a collection of BigIntegers- Returns:
- The sum of the absolute values of the elements of collection c.
-
product
public static BigInteger product(Collection<BigInteger> c)
- Parameters:
c
- a collection of BigIntegers- Returns:
- The product of all elements of collection c, 0 if the collection is empty.
-
-