Package org.eclipse.xtext.nodemodel.impl
Class BasicNodeIterable
- java.lang.Object
-
- org.eclipse.xtext.nodemodel.impl.BasicNodeIterable
-
- All Implemented Interfaces:
java.lang.Iterable<AbstractNode>,BidiIterable<AbstractNode>
public class BasicNodeIterable extends java.lang.Object implements BidiIterable<AbstractNode>
- Noextend:
- This class is not intended to be subclassed by clients.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBasicNodeIterable(AbstractNode startWith)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BidiIterator<AbstractNode>iterator()Returns an iterator that can be used forwards and backwards.BidiIterable<AbstractNode>reverse()Returns a reverse version of this iterable that can be used forwards and backwards.
-
-
-
Constructor Detail
-
BasicNodeIterable
protected BasicNodeIterable(AbstractNode startWith)
-
-
Method Detail
-
iterator
public BidiIterator<AbstractNode> iterator()
Description copied from interface:BidiIterableReturns an iterator that can be used forwards and backwards.- Specified by:
iteratorin interfaceBidiIterable<AbstractNode>- Specified by:
iteratorin interfacejava.lang.Iterable<AbstractNode>- Returns:
- an iterator. Never returns
null.
-
reverse
public BidiIterable<AbstractNode> reverse()
Description copied from interface:BidiIterableReturns a reverse version of this iterable that can be used forwards and backwards. In other words, an iterator provided by the reverse iterable will delegate its
hasNext()andnext()invocations toBidiIterator.hasPrevious()andBidiIterator.previous()respectively.This allows clients to iterate backwards by means of the enhanced for-loop:
for(T t: iterable.reverse()) { // do something with t }- Specified by:
reversein interfaceBidiIterable<AbstractNode>- Returns:
- the reversed iterable. Never returns
null.
-
-