Package ilog.rules.bom.util
Class IlrCollections
java.lang.Object
ilog.rules.bom.util.IlrCollections
This is a utility class which has miscellaneous static methods that
operate on lists and on iterators.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intReturns the size of the array, that is, 0 ifarrayis null, or its length otherwise.static intReturns the size of the list, that is, 0 iflistis null, or its size otherwise.static <T> List<T> Sort(Iterator<T> iter, Comparator<T> c) Creates a list, adds the elements of an iterator to it and then sorts the list according to a sort order defined by way of a comparator.
-
Method Details
-
Sort
Creates a list, adds the elements of an iterator to it and then sorts the list according to a sort order defined by way of a comparator.- Returns:
- the sorted list.
-
getSize
Returns the size of the list, that is, 0 iflistis null, or its size otherwise.- Parameters:
list- A list. It can be null.- Returns:
- The size of the list.
- Since:
- JRules 6.0
-
getSize
Returns the size of the array, that is, 0 ifarrayis null, or its length otherwise.- Parameters:
array- An array. It can be null.- Returns:
- The size of the array.
- Since:
- JRules 6.0
-