Package org.codehaus.commons.compiler.util.iterator

# Class Iterables

java.lang.Object
org.codehaus.commons.compiler.util.iterator.Iterables

public final class Iterables extends Object
Utility method around `Iterable`s and `Iterator`s.

## Method Summary

Modifier and Type
Method
Description
`static <T> Iterable<T>`
`filter(Iterable<? extends T> delegate, Predicate<? super T> predicate)`
`static <T> Iterator<T>`
`filter(Iterator<? extends T> delegate, Predicate<? super T> predicate)`
`static <T> Iterable<T>`
`filter(T[] delegate, Predicate<? super T> predicate)`
`static <T> Iterable<T>`
`filterByClass(Iterable<?> delegate, Class<T> qualifyingClass)`
`static <T> Iterable<T>`
`filterByClass(Object[] delegate, Class<T> qualifyingClass)`
`static <T> Iterator<T>`
`filterByClass(Iterator<?> delegate, Class<T> qualifyingClass)`
`static <T> T[]`
`toArray(Iterable<T> delegate, Class<T> elementType)`
`static <T> T[]`
`toArray(Iterator<T> delegate, Class<T> componentType)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### filterByClass

public static <T> Iterable<T> filterByClass(Object[] delegate, Class<T> qualifyingClass)

Returns:
  An `Iterable` that filters the delegate's elements by base class

### filterByClass

public static <T> Iterable<T> filterByClass(Iterable<?> delegate, Class<T> qualifyingClass)

Returns:
  An `Iterable` that filters the delegate's elements by base class

### filterByClass

public static <T> Iterator<T> filterByClass(Iterator<?> delegate, Class<T> qualifyingClass)

Returns:
  An `Iterator` that filters the delegate's products by base class

### filter

public static <T> Iterable<T> filter(T[] delegate, Predicate<? super T> predicate)

Returns:
  An `Iterable` that discriminates the delegate's elements with the predicate

### filter

public static <T> Iterable<T> filter(Iterable<? extends T> delegate, Predicate<? super T> predicate)

Returns:
  An `Iterable` that discriminates the delegate's elements with the predicate

### filter

public static <T> Iterator<T> filter(Iterator<? extends T> delegate, Predicate<? super T> predicate)

Returns:
  An `Iterator` that discriminates the delegate's products with the predicate

### toArray

public static <T> T[] toArray(Iterable<T> delegate, Class<T> elementType)

Returns:
  All elements of the delegate

### toArray

public static <T> T[] toArray(Iterator<T> delegate, Class<T> componentType)

Returns:
  All products of the delegate