au.com.prunge.jgenfile.impl
Class AbstractPath.ListPathIterator

java.lang.Object
  |
  +--au.com.prunge.jgenfile.impl.AbstractPath.ListPathIterator
All Implemented Interfaces:
Path.Iterator
Enclosing class:
AbstractPath

protected static class AbstractPath.ListPathIterator
extends Object
implements Path.Iterator

An iterator that uses the item list's collection iterator.

Version:
1.0
Author:
Peter Runge

Constructor Summary
AbstractPath.ListPathIterator(List itemList)
          Constructs a ListPathIterator.
 
Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 au.com.prunge.jgenfile.Directory next()
          Returns the next directory in the iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPath.ListPathIterator

public AbstractPath.ListPathIterator(List itemList)
                              throws NullPointerException
Constructs a ListPathIterator.

Parameters:
itemList - the list of items to iterate through.
Throws:
NullPointerException - if itemList is null.
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: Path.Iterator
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Specified by:
hasNext in interface Path.Iterator
Returns:
true if the iteration has more elements, false if not.
See Also:
Path.Iterator.hasNext()

next

public au.com.prunge.jgenfile.Directory next()
                                      throws NoSuchElementException
Description copied from interface: Path.Iterator
Returns the next directory in the iteration.

Specified by:
next in interface Path.Iterator
Returns:
the next directory in the iteration.
Throws:
NoSuchElementException - if there are no more directories in the iteration.
See Also:
Path.Iterator.next()