Class Token
- java.lang.Object
-
- org.mariuszgromada.math.mxparser.parsertokens.Token
-
public class Token extends Object
Token recognized by mXparser after string tokenization process.
-
-
Field Summary
Fields Modifier and Type Field Description StringkeyWordKey word string (if matched)StringlooksLikeIf token was not matched then looksLike functionality is trying asses the kind of tokenstatic intNOT_MATCHEDIndicator that token was not matchedinttokenIdToken identifierinttokenLevelToken levelStringtokenStrString 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()Token cloning.booleanisBinaryOperator()Verification if the token is a binary operator.booleanisIdentifier()Verification if the token is an identifier.booleanisLeftParenthesis()Verification if the token is a left parenthesis.booleanisNumber()Verification if the token is a number.booleanisParameterSeparator()Verification if the token is a parameter separator.booleanisRightParenthesis()Verification if the token is a right parenthesis.booleanisSpecialTokenName()Verification if the token is represented by a special name in the form [...].booleanisUnaryLeftOperator()Verification if the token is a left unary operator.booleanisUnaryRightOperator()Verification if the token is a right unary operator.booleanisUnicodeRootOperator()Verification if the token represents unicode root operatorstatic TokenmakeMultiplyToken()Creates token representing multiplication operator.
-
-
-
Field Detail
-
NOT_MATCHED
public static final int NOT_MATCHED
Indicator that token was not matched- See Also:
- Constant Field Values
-
tokenStr
public String tokenStr
String token
-
keyWord
public 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 String looksLike
If token was not matched then looksLike functionality is trying asses the kind of token
-
-
Method Detail
-
isUnaryLeftOperator
public boolean isUnaryLeftOperator()
Verification if the token is a left unary operator.- Returns:
- true in case token is unary left operator, otherwise returns false
-
isUnaryRightOperator
public boolean isUnaryRightOperator()
Verification if the token is a right unary operator.- Returns:
- true in case token is unary right operator, otherwise returns false
-
isLeftParenthesis
public boolean isLeftParenthesis()
Verification if the token is a left parenthesis.- Returns:
- true in case token is a left parenthesis, otherwise returns false
-
isRightParenthesis
public boolean isRightParenthesis()
Verification if the token is a right parenthesis.- Returns:
- true in case token is a right parenthesis, otherwise returns false
-
isIdentifier
public boolean isIdentifier()
Verification if the token is an identifier.- Returns:
- true in case token is an identifier, otherwise returns false
-
isBinaryOperator
public boolean isBinaryOperator()
Verification if the token is a binary operator.- Returns:
- true in case token is a binary operator, otherwise returns false
-
isParameterSeparator
public boolean isParameterSeparator()
Verification if the token is a parameter separator.- Returns:
- true in case token is a parameter separator, otherwise returns false
-
isNumber
public boolean isNumber()
Verification if the token is a number.- Returns:
- true in case token is a number, otherwise returns false
-
isSpecialTokenName
public boolean isSpecialTokenName()
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
-
isUnicodeRootOperator
public boolean isUnicodeRootOperator()
Verification if the token represents unicode root operator- Returns:
- true in case token represents unicode root operator otherwise returns false
-
makeMultiplyToken
public static Token makeMultiplyToken()
Creates token representing multiplication operator.- Returns:
- token representing multiplication operator.
-
-