jut.lang
Interface OneTimeIterable<T>

All Superinterfaces:
Iterable<T>
All Known Implementing Classes:
AbstractOneTimeIterable, BlockingOpenIterable, OneTimeIterableWrapper

public interface OneTimeIterable<T>
extends Iterable<T>

special purpose restricted version of the Iterable interface. the iterator() method classes implementing this interface may only be called once, subsequent calls should throw an exception.

this interface is part of the problem solution that in the standard JDK the Iterables are supposed to produce any number of Iterators. see also AbstractOneTimeIterable.

Author:
Georg Dietrich

Method Summary
 Iterator<T> iterator()
          the first time called, returns an iterator over a set of elements of type T. subsequent calls should result in an IllegalStateException.
 

Method Detail

iterator

Iterator<T> iterator()
                     throws IllegalStateException
the first time called, returns an iterator over a set of elements of type T. subsequent calls should result in an IllegalStateException.

Specified by:
iterator in interface Iterable<T>
Returns:
an iterator over a set of elements of type T.
Throws:
IllegalStateException - if called more than once.