Package picasso.parser.tokens
Class NumberToken
- java.lang.Object
-
- picasso.parser.tokens.Token
-
- picasso.parser.tokens.NumberToken
-
public class NumberToken extends Token
Represents a number (using double values). Using equals, a NumberToken object compares as true only to another NumberToken object with the same valuea NumberToken is immutable, once created it doesn't change
-
-
Field Summary
-
Fields inherited from class picasso.parser.tokens.Token
ADD_OR_SUBTRACT, ASSIGNMENT, CONSTANT, EXPONENTIATION, GROUPING, MULTIPLY_OR_DIVIDE, UNARY
-
-
Constructor Summary
Constructors Constructor Description NumberToken(double value)
Constructs a token representing value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
boolean
isConstant()
Returns true if this token represents a constant, false otherwiseboolean
isFunction()
Returns true if this token represents a function, false otherwiseString
toString()
Represents the token by its descriptiondouble
value()
-
Methods inherited from class picasso.parser.tokens.Token
getPrecedence
-
-
-
-
Method Detail
-
equals
public boolean equals(Object o)
-
value
public double value()
- Returns:
- the value of this token
-
toString
public String toString()
Description copied from class:Token
Represents the token by its description
-
isConstant
public boolean isConstant()
Description copied from class:Token
Returns true if this token represents a constant, false otherwise- Specified by:
isConstant
in classToken
- Returns:
- true iff this Token represents a constant
-
isFunction
public boolean isFunction()
Description copied from class:Token
Returns true if this token represents a function, false otherwise- Specified by:
isFunction
in classToken
- Returns:
- true iff this Token represents a function
-
-