Class Tokenizer
- java.lang.Object
-
- com.adobe.fontengine.font.postscript.Tokenizer
-
public final class Tokenizer extends java.lang.Object
A postscript tokenizer.Synchronization
This class is NOT threadsafe. Multiple instances can safely coexist without threadsafety issues, but each must only be accessed from one thread (or must be guarded by the client).
-
-
Constructor Summary
Constructors Constructor Description Tokenizer(FontInputStream is)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte
digitValue(byte c)
byte[]
findOptionalTokensAtStartOfLine(byte[][] tokenToFind)
Looks for one of the tokens in tokenToFind in the current stream.void
findToken(byte[] tokenToFind)
Token
getNextPSToken()
static boolean
isDelimiter(int c)
static boolean
isDigit(int c)
static boolean
isExponent(int c)
static boolean
isHex(int c)
static boolean
isNewLine(int c)
static boolean
isRadix(int c, int b)
static boolean
isSign(int c)
static boolean
isWhite(int c)
int
read()
void
setReader(Reader newReader)
-
-
-
Constructor Detail
-
Tokenizer
public Tokenizer(FontInputStream is)
-
-
Method Detail
-
isWhite
public static final boolean isWhite(int c)
-
isNewLine
public static final boolean isNewLine(int c)
-
isDelimiter
public static final boolean isDelimiter(int c)
-
isSign
public static final boolean isSign(int c)
-
isExponent
public static final boolean isExponent(int c)
-
isDigit
public static final boolean isDigit(int c)
-
isHex
public static final boolean isHex(int c)
-
isRadix
public static final boolean isRadix(int c, int b)
-
digitValue
public static final byte digitValue(byte c)
-
getNextPSToken
public Token getNextPSToken() throws InvalidFontException, java.io.IOException, java.lang.IndexOutOfBoundsException
- Throws:
InvalidFontException
java.io.IOException
java.lang.IndexOutOfBoundsException
-
findToken
public void findToken(byte[] tokenToFind) throws java.io.IOException, InvalidFontException
- Throws:
java.io.IOException
InvalidFontException
-
findOptionalTokensAtStartOfLine
public byte[] findOptionalTokensAtStartOfLine(byte[][] tokenToFind) throws java.io.IOException, InvalidFontException
Looks for one of the tokens in tokenToFind in the current stream. Will read until the end of the stream if none of the tokens is found.- Parameters:
tokenToFind
-- Returns:
- the element in tokenToFind that was found, or null if none of the tokens was found.
- Throws:
java.io.IOException
InvalidFontException
-
read
public int read() throws java.io.IOException, InvalidFontException
- Throws:
java.io.IOException
InvalidFontException
-
setReader
public void setReader(Reader newReader) throws InvalidFontException
- Throws:
InvalidFontException
-
-