KickJava   Java API By Example, From Geeks To Geeks.

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


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 20, 2004
10  *
11  * Author Ben Yu
12  */

13 package jfun.parsec.tokens;
14
15 import jfun.parsec.Tokenizer;
16
17 /**
18  * This implementation of Tokenizer transforms the recognized
19  * character range to a String.
20  * @author Ben Yu
21  *
22  * Dec 20, 2004
23  */

24 @Deprecated JavaDoc
25 public final class TokenString implements Tokenizer,
26 java.io.Serializable JavaDoc{
27
28   /**
29    *
30    */

31   private TokenString() {}
32   private static final Tokenizer singleton = new TokenString();
33   /**
34    * Get the Tokenizer instance.
35    * @return the Tokenizer instance.
36    */

37   public static Tokenizer getTokenizer(){return singleton;}
38   /*
39    * @see jfun.parsec.Tokenizer#toToken(java.lang.CharSequence, int, int)
40    */

41   public Object JavaDoc toToken(CharSequence JavaDoc cs, int from, int len) {
42     return cs.subSequence(from, from+len);
43   }
44
45 }
46
Popular Tags