Modifier and Type | Field and Description |
---|---|
protected int |
count
Number of directories that have been retrieved using next.
|
protected File |
currentDir |
protected DirWalker.Level |
currentLevel |
protected int |
depth
Depth of the search tree.
|
protected boolean |
done
Set to true after the last directory has been retrieved using
the next method.
|
protected boolean |
initial
Set to false after first directory has been retrieved using the
next method.
|
protected ArrayList<DirWalker.Level> |
levels
Array of Level objects representing the levels in the tree
search.
|
protected int |
limit |
protected File |
nextDir |
protected File |
root |
Constructor and Description |
---|
DirIterator(File value)
Constructor using depth first search.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Determines if there are more items in the list.
|
File |
next()
Returns the next item in the list.
|
void |
remove()
This method is an optional method that is not implemented for this class.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
protected int depth
A value of zero means that there are no levels. A value of n means that there are n levels and the highest level is n-1.
protected ArrayList<DirWalker.Level> levels
The current positions in the levels at the start of executing next represent the next item to be retrieved.
protected boolean done
protected boolean initial
protected DirWalker.Level currentLevel
protected File currentDir
protected int limit
protected int count
public DirIterator(File value) throws IOException
value
- root directoryIOException
- if io problemspublic File next() throws NoSuchElementException
next
in interface Iterator<File>
NoSuchElementException
public boolean hasNext()
Copyright © 2017. All rights reserved.