picasso.parser.tokens
Class ColorToken

java.lang.Object
  extended by picasso.parser.tokens.Token
      extended by picasso.parser.tokens.ColorToken

public class ColorToken
extends Token

Represents a color (using double values).

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

Author:
Sara Sprenkle

Constructor Summary
ColorToken(double red, double green, double blue)
          Constructs a token representing value
 
Method Summary
 boolean equals(java.lang.Object o)
           
 double getBlue()
           
 double getGreen()
           
 double getRed()
           
 boolean isConstant()
           
 boolean isFunction()
           
static boolean isValidValue(double value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColorToken

public ColorToken(double red,
                  double green,
                  double blue)
Constructs a token representing value

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

isValidValue

public static boolean isValidValue(double value)

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

toString

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

getRed

public double getRed()
Returns:
the red

getGreen

public double getGreen()
Returns:
the green

getBlue

public double getBlue()
Returns:
the blue

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