java.lang.Object
org.jhotdraw8.collection.iterator.Iterators

public class Iterators extends Object
Provides static utility methods for iterators.
Author:
Werner Randelshofer
  • Method Details

    • toList

      public static <T> List<T> toList(Iterable<T> iterable)
      Creates a list from an Iterable. If the Iterable is a list, it is returned.
      Type Parameters:
      T - the value type
      Parameters:
      iterable - the iterable
      Returns:
      the list
    • unmodifiableIterator

      public static <E> Iterator<E> unmodifiableIterator(Iterator<E> iterator)