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 intgetIndex()Gets the value of index.StringgetValue()Gets the value of value.StringtoString()
-
-
-
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:
toStringin classObject- See Also:
Object.toString()
-
-