|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.antlr.stringtemplate.language.StripIterator
public class StripIterator
Given an iterator, return only the non-null elements via next().
Field Summary | |
---|---|
protected java.util.Iterator |
it
|
protected java.lang.Object |
lookahead
To know if stripped iterator hasNext(), we need to see if there is another non-null element or not. |
Constructor Summary | |
---|---|
StripIterator(java.util.Iterator it)
|
Method Summary | |
---|---|
protected void |
consume()
Set lookahead to next non-null element or null if nothing left |
boolean |
hasNext()
Either the list has more stuff or our lookahead has last element |
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 list w/o nulls. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Iterator it
protected java.lang.Object lookahead
Constructor Detail |
---|
public StripIterator(java.util.Iterator it)
Method Detail |
---|
protected void consume()
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public void remove()
remove
in interface java.util.Iterator
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |