KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > parsec > tokens > TokenArray


1 /*****************************************************************************
2  * Copyright (C) Zephyr Business Solutions Corp. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  *****************************************************************************/

8 /*
9  * Created on Dec 9, 2004
10  *
11  * Author Ben Yu
12  */

13 package jfun.parsec.tokens;
14
15 import java.util.ArrayList JavaDoc;
16
17 import jfun.parsec.Tok;
18
19 /**
20  * @author Ben Yu
21  *
22  * Dec 9, 2004
23  */

24 final class TokenArray extends ArrayList JavaDoc {
25   TokenArray(int init){super(init);}
26   TokenArray(){}
27   void addToken(Tok tok){
28     super.add(tok);
29   }
30   void retain(int cnt){
31     removeRange(cnt, size());
32   }
33   Tok[] toTokenArray(){
34     final Tok[] ret = new Tok[size()];
35     toArray(ret);
36     return ret;
37   }
38 }
39
Popular Tags