类 Iterators


  • public class Iterators
    extends java.lang.Object
    Utils methods for Iterator
    • 构造器概要

      构造器 
      构造器 说明
      Iterators()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static <T> java.util.Optional<T> next​(java.util.Iterator<T> it)
      Return next element data of iterator.
      static <T> @Nullable T nextOrNull​(java.util.Iterator<T> it)
      Return next element data of iterator.
      static <T> java.util.stream.Stream<T> stream​(java.util.Iterator<T> it)
      Wrap iterator as Stream
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • Iterators

        public Iterators()
    • 方法详细资料

      • stream

        public static <T> java.util.stream.Stream<T> stream​(java.util.Iterator<T> it)
        Wrap iterator as Stream
        类型参数:
        T - the element type
        参数:
        it - the iterator
        返回:
        Stream contains remaining data in iterator
      • next

        public static <T> java.util.Optional<T> next​(java.util.Iterator<T> it)
        Return next element data of iterator. If not has next element, return Optional.empty(). The element in Iterator cannot be null, or NullPointerException will be thrown.
        类型参数:
        T - the element type
        参数:
        it - the iterator
        返回:
        Optional contains the next element of iterator.
      • nextOrNull

        public static <T> @Nullable T nextOrNull​(java.util.Iterator<T> it)
        Return next element data of iterator. If not has next element, return null.
        类型参数:
        T - the element type
        参数:
        it - the iterator
        返回:
        the next element of iterator.