Package com.teamten.tex
Class Token
java.lang.Object
com.teamten.tex.Token
The commands we know about, and how to encode them as code points.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
fromCharacter
(int ch) Return the pseudo-codepoint for the character command.static int
fromKeyword
(String keyword) Return the pseudo-codepoint for the keyword, or -1 if not found.static boolean
isCommand
(int ch) Whether the token is a command (\hbox or \+).static int
toCharacter
(int ch) Return the code point for the original command, or -1 if not a character command.static String
toKeyword
(int ch) Return the keyword for the character, or null if it doesn't map to a keyword.static String
toString
(int token) Convert to a user-friendly command, with backslash prefix if necessary.
-
Field Details
-
HBOX
public static final int HBOX- See Also:
-
GLUE
public static final int GLUE- See Also:
-
PLUS
public static final int PLUS- See Also:
-
MINUS
public static final int MINUS- See Also:
-
PENALTY
public static final int PENALTY- See Also:
-
VBOX
public static final int VBOX- See Also:
-
-
Constructor Details
-
Token
public Token()
-
-
Method Details
-
fromKeyword
Return the pseudo-codepoint for the keyword, or -1 if not found. -
toKeyword
Return the keyword for the character, or null if it doesn't map to a keyword. -
fromCharacter
public static int fromCharacter(int ch) Return the pseudo-codepoint for the character command.- Throws:
IllegalArgumentException
- if the character is too large to fit in the private use area.
-
toCharacter
public static int toCharacter(int ch) Return the code point for the original command, or -1 if not a character command. -
isCommand
public static boolean isCommand(int ch) Whether the token is a command (\hbox or \+). -
toString
Convert to a user-friendly command, with backslash prefix if necessary.
-