|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dante.extex.interpreter.type.tokens.Tokens
This class is a container for a list of
Token
s.
Field Summary | |
static Tokens |
EMPTY
This constant is the empty token register. |
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
Constructor Summary | |
Tokens()
Creates a new object which does not contain any elements. |
|
Tokens(Context context,
java.lang.CharSequence s)
Creates a new object |
|
Tokens(Context context,
long num)
Creates a new object |
|
Tokens(Token t)
Creates a new object. |
Method Summary | |
void |
add(Token t)
Add another token to the end of the Tokens. |
void |
add(TokenFactory factory,
java.lang.CharSequence s)
Add all characters from the given String to the list of Tokens. |
void |
add(Tokens toks)
Add another token list to the end of the Tokens. |
void |
clear()
This method removes all elements from the tokens list. |
boolean |
equals(java.lang.Object object)
|
Token |
get(int i)
Get a specified token from the toks register. |
int |
hashCode()
|
void |
insert(int index,
Token t)
Add a token to the list at a certain position. |
int |
length()
Getter for the length of the token register, this is the number of elements contained. |
Token |
removeLast()
Remove the last token from the list and return it. |
void |
show(Context context,
Tokens toks)
Determine the printable representation of the object and append it to a list of Tokens. |
java.lang.String |
toString()
Return a String, which show all tokens in the list. |
void |
toString(java.lang.StringBuffer sb)
Print the token into a StringBuffer. |
java.lang.String |
toText()
Return a String, which shows all tokens (in text format) in the list. |
java.lang.String |
toText(UnicodeChar esc)
Return a String, which shows all tokens (in text format) in the list. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Tokens EMPTY
protected static final long serialVersionUID
Constructor Detail |
public Tokens()
public Tokens(Context context, long num) throws InterpreterException
Each character is converted into a OtherToken
and added to the internal list.
context
- the interpreter contextnum
- the number to add
InterpreterException
- in case of an errorpublic Tokens(Context context, java.lang.CharSequence s) throws InterpreterException
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
.
context
- the interpreter contexts
- the characters to add in a CharSequence
InterpreterException
- in case of an errorpublic Tokens(Token t)
t
- the initial tokenMethod Detail |
public void add(Token t)
t
- The token to addpublic void add(TokenFactory factory, java.lang.CharSequence s) throws CatcodeException
null
then it is ignored: i.e. it is treated
like the empty string.
The Tokens all have the catcode OTHER with exception of spaces which
have the catcode SPACE.
factory
- the TokenFactory to acquire new Tokens froms
- the characters to add in a CharSequence
CatcodeException
- in case of an errorpublic void add(Tokens toks)
toks
- the tokens to addpublic void clear()
public boolean equals(java.lang.Object object)
Object.equals(java.lang.Object)
public Token get(int i)
get
in interface FixedTokens
i
- the index for the token to get
null
if i is out of
boundspublic int hashCode()
Object.hashCode()
public void insert(int index, Token t)
index
- the index to add the token tot
- the token to addpublic int length()
length
in interface FixedTokens
public Token removeLast()
null
is returned.
null
public void show(Context context, Tokens toks) throws CatcodeException
FixedTokens
show
in interface FixedTokens
context
- the processor contexttoks
- the tokens to add to
CatcodeException
FixedTokens.show(
de.dante.extex.interpreter.context.Context,
de.dante.extex.interpreter.type.tokens.Tokens)
public java.lang.String toString()
toString
in interface FixedTokens
public void toString(java.lang.StringBuffer sb)
sb
- the target string bufferpublic java.lang.String toText()
FixedTokens
toText
in interface FixedTokens
FixedTokens.toText()
public java.lang.String toText(UnicodeChar esc)
FixedTokens
toText
in interface FixedTokens
esc
- the escape character to use
FixedTokens.toText(UnicodeChar)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |