org.antlr.stringtemplate.language
Class CatIterator
java.lang.Object
org.antlr.stringtemplate.language.CatIterator
- All Implemented Interfaces:
- java.util.Iterator
public class CatIterator
- extends java.lang.Object
- implements java.util.Iterator
Given a list of iterators, return the combined elements one by one.
Field Summary |
protected java.util.List |
iterators
List of iterators to cat together |
Constructor Summary |
CatIterator(java.util.List iterators)
|
Method Summary |
boolean |
hasNext()
|
java.lang.Object |
next()
|
void |
remove()
|
java.lang.String |
toString()
The result of asking for the string of an iterator is the list of elements
and so this is just the cat'd list of both elements. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
iterators
protected java.util.List iterators
- List of iterators to cat together
CatIterator
public CatIterator(java.util.List iterators)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator
next
public java.lang.Object next()
- Specified by:
next
in interface java.util.Iterator
remove
public void remove()
- Specified by:
remove
in interface java.util.Iterator
toString
public java.lang.String toString()
- The result of asking for the string of an iterator is the list of elements
and so this is just the cat'd list of both elements. This is destructive
in that the iterator cursors have moved to the end after printing.
- Overrides:
toString
in class java.lang.Object
Copyright ? 2006-2009 Terence Parr