All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fife.ui.rsyntaxtextarea.TokenIterator Maven / Gradle / Ivy

The newest version!
/*
 * 08/28/2013
 *
 * TokenIterator.java - An iterator over the Tokens in an RSyntaxDocument.
 * 
 * This library is distributed under a modified BSD license.  See the included
 * RSyntaxTextArea.License.txt file for details.
 */
package org.fife.ui.rsyntaxtextarea;

import java.util.Iterator;


/**
 * Allows you to iterate through all paintable tokens in an
 * RSyntaxDocument.
 *
 * @author Robert Futrell
 * @version 1.0
 */
class TokenIterator implements Iterator {

	private RSyntaxDocument doc;
	private int curLine;
	private Token token;


	/**
	 * Constructor.
	 *
	 * @param doc The document whose tokens we should iterate over.
	 */
	public TokenIterator(RSyntaxDocument doc) {
		this.doc = doc;
		loadTokenListForCurLine();
		int lineCount = getLineCount();
		while ((token==null || !token.isPaintable()) && curLineToken removal is not supported.
	 *
	 * @throws UnsupportedOperationException always.
	 */
	public void remove() {
		throw new UnsupportedOperationException();
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy