Class IteratorUtil


  • public class IteratorUtil
    extends java.lang.Object
    utilities dealing with Iterators
    • Constructor Summary

      Constructors 
      Constructor Description
      IteratorUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> boolean contains​(java.util.Iterator<? extends T> it, T o)  
      static <T> int count​(java.util.Iterator<T> it)  
      static <T,​S extends T>
      java.util.Iterator<S>
      filter​(java.util.Iterator<T> iterator, java.lang.Class<S> cls)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IteratorUtil

        public IteratorUtil()
    • Method Detail

      • contains

        public static <T> boolean contains​(java.util.Iterator<? extends T> it,
                                           T o)
        Returns:
        true iff the Iterator returns some elements which equals() the object o
      • count

        public static final <T> int count​(java.util.Iterator<T> it)
                                   throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • filter

        public static <T,​S extends T> java.util.Iterator<S> filter​(java.util.Iterator<T> iterator,
                                                                         java.lang.Class<S> cls)