Package de.tilman_neumann.jml.base
Class IntCollectionUtil
- java.lang.Object
-
- de.tilman_neumann.jml.base.IntCollectionUtil
-
public class IntCollectionUtil extends Object
Utility methods for collections of Integers.- Author:
- Tilman Neumann
-
-
Constructor Summary
Constructors Constructor Description IntCollectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
max(Collection<Integer> c)
Returns the maximum value of the given non-negative integer collection.static ArrayList<Integer>
stringToList(String str)
Converts the given comma-separated string into a list of Integers.
-
-
-
Method Detail
-
stringToList
public static ArrayList<Integer> stringToList(String str)
Converts the given comma-separated string into a list of Integers.- Parameters:
str
-- Returns:
- list of sequence elements
-
max
public static int max(Collection<Integer> c)
Returns the maximum value of the given non-negative integer collection.- Parameters:
c
- the collection (not null)- Returns:
- the biggest element, or 0 if the collection is empty
-
-