Top Description Inners Constructors Methods
org.codehaus.commons.compiler.util.iterator

public final Class Iterables

extends Object
Class Inheritance
Imports
java.lang.reflect.Array, java.util.ArrayList, .Arrays, .Iterator, .List, .NoSuchElementException, org.codehaus.commons.compiler.util.Predicate, org.codehaus.commons.nullanalysis.Nullable

Utility method around Iterables and Iterators.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T> Iterable<T>

Returns:

An Iterable that discriminates the delegate's elements with the predicate
filter
(T[] delegate, final Predicate<? super T> predicate)

public static <T> Iterable<T>

Returns:

An Iterable that discriminates the delegate's elements with the predicate
filter
(final Iterable<? extends T> delegate, final Predicate<? super T> predicate)

public static <T> Iterator<T>

Returns:

An Iterator that discriminates the delegate's products with the predicate
filter
(final Iterator<? extends T> delegate, final Predicate<? super T> predicate)

public static <T> Iterable<T>

Returns:

An Iterable that filters the delegate's elements by base class
filterByClass
(Object[] delegate, final Class<T> qualifyingClass)

public static <T> Iterable<T>

Returns:

An Iterable that filters the delegate's elements by base class
filterByClass
(final Iterable<?> delegate, final Class<T> qualifyingClass)

public static <T> Iterator<T>

Returns:

An Iterator that filters the delegate's products by base class
filterByClass
(Iterator<?> delegate, final Class<T> qualifyingClass)

public static <T> T[]

Returns:

All elements of the delegate
toArray
(Iterable<T> delegate, Class<T> elementType)

public static <T> T[]

Returns:

All products of the delegate
toArray
(Iterator<T> delegate, Class<T> componentType)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Iterablesback to summary
private Iterables()

Method Detail

filterback to summary
public static <T> Iterable<T> filter(T[] delegate, final Predicate<? super T> predicate)
Returns:Iterable<T>

An Iterable that discriminates the delegate's elements with the predicate

filterback to summary
public static <T> Iterable<T> filter(final Iterable<? extends T> delegate, final Predicate<? super T> predicate)
Returns:Iterable<T>

An Iterable that discriminates the delegate's elements with the predicate

filterback to summary
public static <T> Iterator<T> filter(final Iterator<? extends T> delegate, final Predicate<? super T> predicate)
Returns:Iterator<T>

An Iterator that discriminates the delegate's products with the predicate

filterByClassback to summary
public static <T> Iterable<T> filterByClass(Object[] delegate, final Class<T> qualifyingClass)
Returns:Iterable<T>

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

filterByClassback to summary
public static <T> Iterable<T> filterByClass(final Iterable<?> delegate, final Class<T> qualifyingClass)
Returns:Iterable<T>

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

filterByClassback to summary
public static <T> Iterator<T> filterByClass(Iterator<?> delegate, final Class<T> qualifyingClass)
Returns:Iterator<T>

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

toArrayback to summary
public static <T> T[] toArray(Iterable<T> delegate, Class<T> elementType)
Returns:T[]

All elements of the delegate

toArrayback to summary
public static <T> T[] toArray(Iterator<T> delegate, Class<T> componentType)
Returns:T[]

All products of the delegate

org.codehaus.commons.compiler.util.iterator back to summary

private final Enum Iterables.State

extends Enum<Iterables.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Iterables.State
AT_END

The delegate Iterator is at its end.

public static final Iterables.State
DEFAULT

No element has been read ahead.

public static final Iterables.State
READ_AHEAD

The next element has been read ahead.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Iterables.State
public static Iterables.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AT_ENDback to summary
public static final Iterables.State AT_END

The delegate Iterator is at its end.

DEFAULTback to summary
public static final Iterables.State DEFAULT

No element has been read ahead.

READ_AHEADback to summary
public static final Iterables.State READ_AHEAD

The next element has been read ahead.

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static Iterables.State valueOf(String name)
valuesback to summary
public static Iterables.State[] values()