OCPsoft Common API 1.0.5.Final

org.ocpsoft.common.util
Class Iterators

java.lang.Object
  extended by 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 Summary
Iterators()
           
 
Method Summary
static
<T> List<T>
asList(Iterable<T> iterable)
          Return the elements of the given Iterable as a List.
static
<T> List<T>
asList(Iterator<T> iterator)
          Return the elements of the given Iterator as a List.
static
<T> Set<T>
asSet(Iterable<T> iterable)
          Return the elements of the given Iterable as a List.
static
<T> Set<T>
asSet(Iterator<T> iterator)
          Return the elements of the given Iterator as a List.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iterators

public Iterators()
Method Detail

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.


OCPsoft Common API 1.0.5.Final

Copyright © 2012 OCPsoft. All Rights Reserved.