Class IteratorUtil


  • public final class IteratorUtil
    extends Object
    • Method Detail

      • getUniformClass

        public static Class getUniformClass​(Iterator<?> iter)
        Parameters:
        iter -
        Returns:
        the Class of the elements, or null if all null or different
      • isUniformClass

        public static <T> boolean isUniformClass​(Iterator<?> iter,
                                                 Class<T> theClass,
                                                 boolean exactMatch)
        Parameters:
        iter -
        theClass -
        exactMatch - if true, then subclasses are considered to be different
        Returns:
        true if all items are of the same class