Class ExpressionToken
- java.lang.Object
-
- org.vedantatree.expressionoasis.grammar.ExpressionToken
-
public class ExpressionToken extends Object
This class represents the expression token generated by the parser while parsing the string expression. It contains the token string and index in the expression string. Example: 1+2+pow(3,4) 1, +, 2, +, pow, (, 3, ',', 4, ) are tokens
-
-
Constructor Summary
Constructors Constructor Description ExpressionToken(String value, int index)
Constructs the ExpressionToken
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIndex()
Gets the value of index.String
getValue()
Gets the value of value.String
toString()
-
-
-
Constructor Detail
-
ExpressionToken
public ExpressionToken(String value, int index)
Constructs the ExpressionToken- Parameters:
value
-index
-
-
-
Method Detail
-
getIndex
public int getIndex()
Gets the value of index.- Returns:
- Returns the index.
-
getValue
public String getValue()
Gets the value of value.- Returns:
- Returns the value.
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
-