Package org.eclipse.xtext.nodemodel.impl
Class BasicNodeTreeIterator
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<AbstractNode>
-
- org.eclipse.xtext.nodemodel.impl.BasicNodeTreeIterator
-
- All Implemented Interfaces:
java.util.Iterator<AbstractNode>,org.eclipse.emf.common.util.TreeIterator<AbstractNode>,BidiIterator<AbstractNode>,BidiTreeIterator<AbstractNode>
public class BasicNodeTreeIterator extends com.google.common.collect.UnmodifiableIterator<AbstractNode> implements BidiTreeIterator<AbstractNode>
- Noextend:
- This class is not intended to be subclassed by clients.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBasicNodeTreeIterator(AbstractNode root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterAdvance()booleanhasNext()booleanhasPrevious()Returns true if this bidi iterator has more elements when traversing in the reverse direction.AbstractNodenext()AbstractNodeprevious()Returns the previous element.voidprune()
-
-
-
Constructor Detail
-
BasicNodeTreeIterator
protected BasicNodeTreeIterator(AbstractNode root)
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<AbstractNode>
-
next
public AbstractNode next()
Description copied from interface:BidiTreeIteratorIntermixed 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:
nextin interfaceBidiTreeIterator<AbstractNode>- Specified by:
nextin interfacejava.util.Iterator<AbstractNode>
-
afterAdvance
protected void afterAdvance()
-
hasPrevious
public boolean hasPrevious()
Description copied from interface:BidiIteratorReturns 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:
hasPreviousin interfaceBidiIterator<AbstractNode>- Returns:
- true if the bidi iterator has more elements when traversing in the reverse direction.
-
previous
public AbstractNode previous()
Description copied from interface:BidiTreeIteratorReturns 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:
previousin interfaceBidiIterator<AbstractNode>- Specified by:
previousin interfaceBidiTreeIterator<AbstractNode>- Returns:
- the previous element.
-
prune
public void prune()
- Specified by:
prunein interfaceorg.eclipse.emf.common.util.TreeIterator<AbstractNode>
-
-