KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > freemarker > eclipse > test > util > TokenList


1 package freemarker.eclipse.test.util;
2
3 import java.util.ArrayList JavaDoc;
4
5 import org.eclipse.jface.text.rules.IToken;
6
7 /**
8  * A list of tokens. Provides convenience method to add a token for
9  * a range of indices. Used by ScannerTest-s.
10  *
11  * @author <a HREF="mailto:stephan&#64;chaquotay.net">Stephan Mueller</a>
12  * @version $Id: TokenList.java,v 1.1 2004/02/05 00:17:52 stephanmueller Exp $
13  */

14 public class TokenList extends ArrayList JavaDoc {
15
16     public void addToken(IToken token, int count) {
17         for (int i = 0; i < count; i++) {
18             this.add(token);
19         }
20     }
21     
22     public IToken getToken(int i) {
23         return (IToken)this.get(i);
24     }
25     
26 }
27
Popular Tags