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
-
-
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 booleanequals(Object o)booleanisConstant()Returns true if this token represents a constant, false otherwisebooleanisFunction()Returns true if this token represents a function, false otherwiseStringtoString()Represents the token by its descriptiondoublevalue()
-
-
-
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:TokenRepresents the token by its description
-
isConstant
public boolean isConstant()
Description copied from class:TokenReturns true if this token represents a constant, false otherwise- Specified by:
isConstantin classToken- Returns:
- true iff this Token represents a constant
-
isFunction
public boolean isFunction()
Description copied from class:TokenReturns true if this token represents a function, false otherwise- Specified by:
isFunctionin classToken- Returns:
- true iff this Token represents a function
-
-