APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.tools.javac.util

public Class Iterators

extends Object
Class Inheritance
Imports
java.util.Collections, .Iterator, .NoSuchElementException, java.util.function.Function, .Predicate

Utilities for Iterators.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Iterator<?>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <I, O> Iterator<O>
createCompoundIterator(Iterable<I> inputs, Function<I, Iterator<O>> converter)

public static <E> Iterator<E>
public static <T> Iterator<T>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTYback to summary
private static final Iterator<?> EMPTY

Constructor Detail

Iteratorsback to summary
public Iterators()

Method Detail

createCompoundIteratorback to summary
public static <I, O> Iterator<O> createCompoundIterator(Iterable<I> inputs, Function<I, Iterator<O>> converter)
createFilterIteratorback to summary
public static <E> Iterator<E> createFilterIterator(Iterator<E> input, Predicate<E> test)
emptyIteratorback to summary
public static <T> Iterator<T> emptyIterator()
Annotations
@SuppressWarnings:unchecked
com.sun.tools.javac.util back to summary

private Class Iterators.CompoundIterator<I, O>

extends Object
implements Iterator<O>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private final Function<I, Iterator<O>>
private Iterator<O>
private final Iterator<I>

Constructor Summary

AccessConstructor and Description
public
CompoundIterator(Iterable<I> inputs, Function<I, Iterator<O>> converter)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public O
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

converterback to summary
private final Function<I, Iterator<O>> converter
currentIteratorback to summary
private Iterator<O> currentIterator
inputsback to summary
private final Iterator<I> inputs

Constructor Detail

CompoundIteratorback to summary
public CompoundIterator(Iterable<I> inputs, Function<I, Iterator<O>> converter)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Annotations
@Override
nextback to summary
public O next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Annotations
@Override