Token.java
1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.types.ASName
*/
package com.adobe.internal.pdftoolkit.pdf.content;
import com.adobe.internal.pdftoolkit.core.types.ASName;
import com.adobe.internal.pdftoolkit.pdf.content.TokenType;
class Token {
private TokenType type;
private Object token;
private Token(TokenType tokenType, Object token) {
this.type = tokenType;
this.token = token;
}
static Token newOperand(Object operand) {
return new Token(TokenType.Operand, operand);
}
static Token newOperator(ASName operator) {
return new Token(TokenType.Operator, (Object)operator);
}
TokenType getType() {
return this.type;
}
Object getValue() {
return this.token;
}
public String toString() {
if (this.type == TokenType.Operator) {
return "Operator: " + ((ASName)this.token).asString(true);
}
return "Operand: " + this.token.toString();
}
}