|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TokenFactory
This is the interface for the token factory. The token factory is the only instance to deliver new tokens. It is up to the implementation of the factory to create new tokens or to cache some of them and deliver the same token several times.
| Method Summary | |
|---|---|
Token |
createToken(Catcode code,
int c,
java.lang.String namespace)
Create a new Token of the
appropriate kind. |
Token |
createToken(Catcode code,
UnicodeChar c,
java.lang.String namespace)
Get an instance of a token with a given Catcode and Unicode character value. |
Token |
createToken(Catcode code,
UnicodeChar esc,
java.lang.String value,
java.lang.String namespace)
Get an instance of a token with a given Catcode and value. |
Tokens |
toTokens(java.lang.CharSequence s)
Convert a character sequence to a list of tokens. |
Tokens |
toTokens(long l)
Convert a long value into a list of tokens. |
| Method Detail |
|---|
Token createToken(Catcode code,
UnicodeChar esc,
java.lang.String value,
java.lang.String namespace)
throws CatcodeException
code - the catcodeesc - the Unicode character value of the escape charactervalue - the valuenamespace - the name space for the token. This is relevant for
ACTIVE and ESCAPE category codes only.
CatcodeException - in case of an error
Token createToken(Catcode code,
int c,
java.lang.String namespace)
throws CatcodeException
Token of the
appropriate kind. Tokens are immutable (no setters) thus the factory
pattern can be applied.
code - the category codec - the character valuenamespace - the name space to use
CatcodeException - in case of an error
Token createToken(Catcode code,
UnicodeChar c,
java.lang.String namespace)
throws CatcodeException
code - the catcodec - the Unicode character valuenamespace - the name space for the token. This is relevant for
ACTIVE and ESCAPE category codes only.
CatcodeException - in case of an error
Tokens toTokens(java.lang.CharSequence s)
throws CatcodeException
Each character of the string is converted into a OtherToken
and added to the internal list. An exception is made for spaces which
are converted into a SpaceToken.
s - the character sequence to translate to tokens
CatcodeException - in case of an error
Tokens toTokens(long l)
throws CatcodeException
Each character is converted into a OtherToken
and added to the internal list.
l - the value to convert
CatcodeException - in case of an error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||