picasso.parser.tokens
Class NumberToken

java.lang.Object
  extended by picasso.parser.tokens.Token
      extended by 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 value

a NumberToken is immutable, once created it doesn't change

Author:
Owen Astrachan, Sara Sprenkle

Constructor Summary
NumberToken(double value)
          Constructs a token representing value
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean isConstant()
           
 boolean isFunction()
           
 java.lang.String toString()
           
 double value()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumberToken

public NumberToken(double value)
Constructs a token representing value

Parameters:
value - the value of this number token
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
Returns:
true iff o is a NumberToken with same value

value

public double value()
Returns:
the value of this token

toString

public java.lang.String toString()
Overrides:
toString in class Token

isConstant

public boolean isConstant()
Specified by:
isConstant in class Token
Returns:
true iff this Token represents a constant

isFunction

public boolean isFunction()
Specified by:
isFunction in class Token
Returns:
true iff this Token represents a function