com.atlassian.confluence.util
Class SingleUseIterable<T>
java.lang.Object
com.atlassian.confluence.util.SingleUseIterable<T>
- All Implemented Interfaces:
- Iterable<T>
public class SingleUseIterable<T>
- extends Object
- implements Iterable<T>
An Iterable
wrapper for an iterator. If the iterator is retrieved more than once, an exception
will be thrown.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
create
public static <T> SingleUseIterable<T> create(Iterator<T> iterator)
- Convenience static factory because constructors can't infer generic types.
- Parameters:
iterator
- the iterator to wrap
- Returns:
- the appropriately typed SingleUseIterator
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>
Copyright © 2003-2013 Atlassian. All Rights Reserved.