Package jodd.util

Class CollectionUtil

java.lang.Object
jodd.util.CollectionUtil

public class CollectionUtil extends Object
Some collection utilities.
  • Constructor Details

    • CollectionUtil

      public CollectionUtil()
  • Method Details

    • asEnumeration

      public static <E> Enumeration<E> asEnumeration(Iterator<E> iter)
      Adapt the specified Iterator to the Enumeration interface.
    • asIterator

      public static <E> Iterator<E> asIterator(Enumeration<E> e)
      Adapt the specified Enumeration to the Iterator interface.
    • collectionOf

      public static <T> Collection<T> collectionOf(Iterator<? extends T> iterator)
      Returns a collection containing all elements of the iterator.
    • streamOf

      public static <T> Stream<T> streamOf(Iterator<T> iterator)
      Converts iterator to a stream.
    • streamOf

      public static <T> Stream<T> streamOf(Iterable<T> iterable)
      Converts interable to a non-parallel stream.
    • parallelStreamOf

      public static <T> Stream<T> parallelStreamOf(Iterator<T> iterator)
      Wraps an iterator as a stream.
    • parallelStreamOf

      public static <T> Stream<T> parallelStreamOf(Iterable<T> iterable)
      Wraps an iterator as a stream.