Package de.tilman_neumann.jml.base
Class IntCollectionUtil
java.lang.Object
de.tilman_neumann.jml.base.IntCollectionUtil
public class IntCollectionUtil
extends java.lang.Object
Utility methods for collections of Integers.
-
Constructor Summary
Constructors Constructor Description IntCollectionUtil()
-
Method Summary
Modifier and Type Method Description static int
max(java.util.Collection<java.lang.Integer> c)
Returns the maximum value of the given non-negative integer collection.static java.util.ArrayList<java.lang.Integer>
stringToList(java.lang.String str)
Converts the given comma-separated string into a list of Integers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
IntCollectionUtil
public IntCollectionUtil()
-
-
Method Details
-
stringToList
public static java.util.ArrayList<java.lang.Integer> stringToList(java.lang.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(java.util.Collection<java.lang.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
-