org.eclipse.xtext.ui.editor.syntaxcoloring
Class TokenScanner.RangedReentrantIterator

java.lang.Object
  extended by com.google.common.collect.UnmodifiableIterator<ILexerTokenRegion>
      extended by org.eclipse.xtext.ui.editor.syntaxcoloring.TokenScanner.RangedReentrantIterator
All Implemented Interfaces:
java.util.Iterator<ILexerTokenRegion>
Enclosing class:
TokenScanner

protected class TokenScanner.RangedReentrantIterator
extends com.google.common.collect.UnmodifiableIterator<ILexerTokenRegion>

A reentrant iterator allows to reuse and filter the elements another iterator and may update its filter criteria continuously.

It is assumed that setRange(IDocument, int, int) will be called with ascending order most of the time thus a sorted iterator may be reused and traversed further after the range has been updated.


Constructor Summary
protected TokenScanner.RangedReentrantIterator()
           
 
Method Summary
 boolean hasNext()
           
 ILexerTokenRegion next()
           
 void setRange(org.eclipse.jface.text.IDocument document, int offset, int length)
           
 
Methods inherited from class com.google.common.collect.UnmodifiableIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenScanner.RangedReentrantIterator

protected TokenScanner.RangedReentrantIterator()
Method Detail

hasNext

public boolean hasNext()

next

public ILexerTokenRegion next()

setRange

public void setRange(org.eclipse.jface.text.IDocument document,
                     int offset,
                     int length)