Package org.eclipse.xtext.nodemodel.util
Class NodeTreeIterator
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<INode>
-
- org.eclipse.xtext.nodemodel.util.NodeTreeIterator
-
- All Implemented Interfaces:
java.util.Iterator<INode>
,org.eclipse.emf.common.util.TreeIterator<INode>
,BidiIterator<INode>
,BidiTreeIterator<INode>
public class NodeTreeIterator extends com.google.common.collect.UnmodifiableIterator<INode> implements BidiTreeIterator<INode>
-
-
Constructor Summary
Constructors Constructor Description NodeTreeIterator(INode root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterAdvance()
boolean
hasNext()
boolean
hasPrevious()
Returns true if this bidi iterator has more elements when traversing in the reverse direction.INode
next()
INode
previous()
Returns the previous element.void
prune()
-
-
-
Constructor Detail
-
NodeTreeIterator
public NodeTreeIterator(INode root)
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<INode>
-
next
public INode next()
Description copied from interface:BidiTreeIterator
Intermixed calls to
BidiTreeIterator.next()
andBidiTreeIterator.previous()
may not lead to the very same element since the iterator does not return the parent element when its done with its children but the next sibling of the parent.- Specified by:
next
in interfaceBidiTreeIterator<INode>
- Specified by:
next
in interfacejava.util.Iterator<INode>
-
afterAdvance
protected void afterAdvance()
-
hasPrevious
public boolean hasPrevious()
Description copied from interface:BidiIterator
Returns true if this bidi iterator has more elements when traversing in the reverse direction. (In other words, returns true if previous would return an element rather than throwing an exception.)- Specified by:
hasPrevious
in interfaceBidiIterator<INode>
- Returns:
- true if the bidi iterator has more elements when traversing in the reverse direction.
-
previous
public INode previous()
Description copied from interface:BidiTreeIterator
Returns the previous element. This method may be called repeatedly to iterate backwards, or intermixed with calls to next to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)Intermixed calls to
BidiTreeIterator.next()
andBidiTreeIterator.previous()
may not lead to the very same element since the iterator does not return the parent element when its done with its children but the next sibling of the parent.- Specified by:
previous
in interfaceBidiIterator<INode>
- Specified by:
previous
in interfaceBidiTreeIterator<INode>
- Returns:
- the previous element.
-
prune
public void prune()
- Specified by:
prune
in interfaceorg.eclipse.emf.common.util.TreeIterator<INode>
-
-