picasso.parser.tokens
Class ColorToken
java.lang.Object
picasso.parser.tokens.Token
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 |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
ColorToken
public ColorToken(double red,
double green,
double blue)
- Constructs a token representing value
- Parameters:
value
- the value of this number token
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