Class IlrCollections

java.lang.Object
ilog.rules.bom.util.IlrCollections

public final class IlrCollections extends Object
This is a utility class which has miscellaneous static methods that operate on lists and on iterators.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    getSize(Object[] array)
    Returns the size of the array, that is, 0 if array is null, or its length otherwise.
    static int
    getSize(List<?> list)
    Returns the size of the list, that is, 0 if list is 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • Sort

      public 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.
      Returns:
      the sorted list.
    • getSize

      public static int getSize(List<?> list)
      Returns the size of the list, that is, 0 if list is null, or its size otherwise.
      Parameters:
      list - A list. It can be null.
      Returns:
      The size of the list.
      Since:
      JRules 6.0
    • getSize

      public static int getSize(Object[] array)
      Returns the size of the array, that is, 0 if array is null, or its length otherwise.
      Parameters:
      array - An array. It can be null.
      Returns:
      The size of the array.
      Since:
      JRules 6.0