com.atlassian.jira.util.collect
Class EnclosedIterable.Functions

java.lang.Object
  extended by com.atlassian.jira.util.collect.EnclosedIterable.Functions
Enclosing interface:
EnclosedIterable<T>

public static class EnclosedIterable.Functions
extends java.lang.Object


Constructor Summary
EnclosedIterable.Functions()
           
 
Method Summary
static
<T> void
apply(EnclosedIterable<T> iterable, Consumer<T> sink)
          Pass all the elements of the iterable to the supplied Consumer.
static
<I,O> java.util.List<O>
toList(EnclosedIterable<I> iterable, Function<I,O> transformer)
          Get an ArrayList of the contents of the supplied EnclosedIterable transformed by the supplied transform function into the new type O.
static
<T> java.util.List<T>
toList(EnclosedIterable<T> iterable)
          Get an ArrayList of the contents of the supplied EnclosedIterable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnclosedIterable.Functions

public EnclosedIterable.Functions()
Method Detail

apply

public static <T> void apply(EnclosedIterable<T> iterable,
                             Consumer<T> sink)
Pass all the elements of the iterable to the supplied Consumer. Guarantees that the iterator used will be closed correctly

Parameters:
iterable - containing elements of type T
sink - that will consume the elements

toList

public static <T> java.util.List<T> toList(EnclosedIterable<T> iterable)
Get an ArrayList of the contents of the supplied EnclosedIterable

Returns:
a mutable ArrayList containing all elements of the iterable.

toList

public static <I,O> java.util.List<O> toList(EnclosedIterable<I> iterable,
                                             Function<I,O> transformer)
Get an ArrayList of the contents of the supplied EnclosedIterable transformed by the supplied transform function into the new type O.

Returns:
a mutable ArrayList containing all elements of the iterable.


Copyright © 2002-2010 Atlassian. All Rights Reserved.