private static class TreeNodeCollectionResource.NodesIterator extends java.lang.Object implements java.util.Iterator<TreeNodeResource>
Modifier and Type | Field and Description |
---|---|
private java.util.Stack<java.util.Iterator<TreeNodeResource>> |
stack
Stack of iterators to handle recursion.
|
private boolean |
visibleOnly
All or only expanded nodes to be iterated
|
Constructor and Description |
---|
NodesIterator(java.util.Iterator<TreeNodeResource> nodes,
boolean visibleOnly)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns
true if the iteration has more elements. |
TreeNodeResource |
next()
Returns the next element in the iteration.
|
private java.util.Stack<java.util.Iterator<TreeNodeResource>> stack
private boolean visibleOnly
public NodesIterator(java.util.Iterator<TreeNodeResource> nodes, boolean visibleOnly)
nodes
- The nodes to iterate.visibleOnly
- All or only expanded nodes to be iterated.public boolean hasNext()
true
if the iteration has more elements.
(In other words, returns true
if next()
would
return an element rather than throwing an exception.)hasNext
in interface java.util.Iterator<TreeNodeResource>
true
if the iteration has more elementspublic TreeNodeResource next()
next
in interface java.util.Iterator<TreeNodeResource>
java.util.NoSuchElementException
- if the iteration has no more elements