Class Token
- java.lang.Object
-
- org.mariuszgromada.math.mxparser.parsertokens.Token
-
- All Implemented Interfaces:
java.io.Serializable
public class Token extends java.lang.Object implements java.io.SerializableToken recognized by mXparser after string tokenization process.- Version:
- 6.1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringkeyWordKey word string (if matched)java.lang.StringlooksLikeIf token was not matched then looksLike functionality is trying asses the kind of tokenstatic intNOT_MATCHEDIndicator that token was not matchedprivate static intserialClassIDprivate static longserialVersionUIDinttokenIdToken identifierinttokenLevelToken leveljava.lang.StringtokenStrString tokeninttokenTypeIdToken typedoubletokenValueToken value if number
-
Constructor Summary
Constructors Constructor Description Token()Default constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tokenclone()static Tokenclone(Token token)Token cloning.static java.lang.StringgetTokenTypeDescription(int tokenTypeId)Returns token type description.booleanisBinaryOperator()static booleanisBinaryOperator(Token token)Verification if the token is a binary operator.booleanisIdentifier()static booleanisIdentifier(Token token)Verification if the token is an identifier.booleanisLeftParenthesis()static booleanisLeftParenthesis(Token token)Verification if the token is a left parenthesis.booleanisNumber()static booleanisNumber(Token token)Verification if the token is a number.booleanisParameterSeparator()static booleanisParameterSeparator(Token token)Verification if the token is a parameter separator.booleanisRightParenthesis()static booleanisRightParenthesis(Token token)Verification if the token is a right parenthesis.booleanisSpecialTokenName()static booleanisSpecialTokenName(Token token)Verification if the token is represented by a special name in the form [...].booleanisUnaryLeftOperator()static booleanisUnaryLeftOperator(Token token)Verification if the token is a left unary operator.booleanisUnaryRightOperator()static booleanisUnaryRightOperator(Token token)Verification if the token is a right unary operator.booleanisUnicodeRootOperator()static booleanisUnicodeRootOperator(Token token)Verification if the token represents unicode root operatorstatic TokenmakeMultiplyToken()Creates token representing multiplication operator.
-
-
-
Field Detail
-
serialClassID
private static final int serialClassID
- See Also:
- Constant Field Values
-
serialVersionUID
private static final long serialVersionUID
-
NOT_MATCHED
public static final int NOT_MATCHED
Indicator that token was not matched- See Also:
- Constant Field Values
-
tokenStr
public java.lang.String tokenStr
String token
-
keyWord
public java.lang.String keyWord
Key word string (if matched)
-
tokenId
public int tokenId
Token identifier
-
tokenTypeId
public int tokenTypeId
Token type
-
tokenLevel
public int tokenLevel
Token level
-
tokenValue
public double tokenValue
Token value if number
-
looksLike
public java.lang.String looksLike
If token was not matched then looksLike functionality is trying asses the kind of token
-
-
Method Detail
-
isUnaryLeftOperator
public static boolean isUnaryLeftOperator(Token token)
Verification if the token is a left unary operator.- Returns:
- true in case token is unary left operator, otherwise returns false
-
isUnaryLeftOperator
public boolean isUnaryLeftOperator()
-
isUnaryRightOperator
public static boolean isUnaryRightOperator(Token token)
Verification if the token is a right unary operator.- Returns:
- true in case token is unary right operator, otherwise returns false
-
isUnaryRightOperator
public boolean isUnaryRightOperator()
-
isLeftParenthesis
public static boolean isLeftParenthesis(Token token)
Verification if the token is a left parenthesis.- Returns:
- true in case token is a left parenthesis, otherwise returns false
-
isLeftParenthesis
public boolean isLeftParenthesis()
-
isRightParenthesis
public static boolean isRightParenthesis(Token token)
Verification if the token is a right parenthesis.- Returns:
- true in case token is a right parenthesis, otherwise returns false
-
isRightParenthesis
public boolean isRightParenthesis()
-
isIdentifier
public static boolean isIdentifier(Token token)
Verification if the token is an identifier.- Returns:
- true in case token is an identifier, otherwise returns false
-
isIdentifier
public boolean isIdentifier()
-
isBinaryOperator
public static boolean isBinaryOperator(Token token)
Verification if the token is a binary operator.- Returns:
- true in case token is a binary operator, otherwise returns false
-
isBinaryOperator
public boolean isBinaryOperator()
-
isParameterSeparator
public static boolean isParameterSeparator(Token token)
Verification if the token is a parameter separator.- Returns:
- true in case token is a parameter separator, otherwise returns false
-
isParameterSeparator
public boolean isParameterSeparator()
-
isNumber
public static boolean isNumber(Token token)
Verification if the token is a number.- Returns:
- true in case token is a number, otherwise returns false
-
isNumber
public boolean isNumber()
-
isSpecialTokenName
public static boolean isSpecialTokenName(Token token)
Verification if the token is represented by a special name in the form [...].- Returns:
- true in case token is represented by a special name in the form [...], otherwise returns false
-
isSpecialTokenName
public boolean isSpecialTokenName()
-
isUnicodeRootOperator
public static boolean isUnicodeRootOperator(Token token)
Verification if the token represents unicode root operator- Returns:
- true in case token represents unicode root operator otherwise returns false
-
isUnicodeRootOperator
public boolean isUnicodeRootOperator()
-
makeMultiplyToken
public static Token makeMultiplyToken()
Creates token representing multiplication operator.- Returns:
- token representing multiplication operator.
-
getTokenTypeDescription
public static java.lang.String getTokenTypeDescription(int tokenTypeId)
Returns token type description.- Parameters:
tokenTypeId- Token type id- Returns:
- String representing token type description.
-
clone
public Token clone()
- Overrides:
clonein classjava.lang.Object
-
-