com.atlassian.confluence.util
Class SingleUseIterable<T>

java.lang.Object
  extended by com.atlassian.confluence.util.SingleUseIterable<T>
All Implemented Interfaces:
java.lang.Iterable<T>

public class SingleUseIterable<T>
extends java.lang.Object
implements java.lang.Iterable<T>

An Iterable wrapper for an iterator. If the iterator is retrieved more than once, an exception will be thrown.


Method Summary
static
<T> SingleUseIterable<T>
create(java.util.Iterator<T> iterator)
          Convenience static factory because constructors can't infer generic types.
 java.util.Iterator<T> iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static <T> SingleUseIterable<T> create(java.util.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 java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>


Copyright © 2003-2013 Atlassian. All Rights Reserved.