Class Iterators

java.lang.Object
org.ocpsoft.common.util.Iterators

public final class Iterators extends Object
Utility methods for working with Iterator and Iterable instances.
Author:
Lincoln Baxter, III
  • Constructor Details

    • Iterators

      public Iterators()
  • Method Details

    • asList

      public static <T> List<T> asList(Iterable<T> iterable)
      Return the elements of the given Iterable as a List.
    • asList

      public static <T> List<T> asList(Iterator<T> iterator)
      Return the elements of the given Iterator as a List.
    • asSet

      public static <T> Set<T> asSet(Iterable<T> iterable)
      Return the elements of the given Iterable as a List.
    • asSet

      public static <T> Set<T> asSet(Iterator<T> iterator)
      Return the elements of the given Iterator as a List.