Class CardColor

java.lang.Object
  |
  +--CardColor

public class CardColor
extends Object

CardColor stores a single color to be used in the SetMaster game.

Version:
Jan. 2004
Author:
Tim Corica

Field Summary
static int BLUE
           
static int GREEN
           
static int RED
           
 
Constructor Summary
CardColor(int color)
          Constructor for objects of class SetColor.
 
Method Summary
 boolean equals(Object o)
          Returns true if and only if this object represents the same color as o
static int getFirst()
           
static int getLast()
           
 Color getScreenColor()
          Returns a graphical color object corresponding the to color of this object.
 String toString()
          Returns simple text giving the color in English.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLUE

public static final int BLUE
See Also:
Constant Field Values

GREEN

public static final int GREEN
See Also:
Constant Field Values

RED

public static final int RED
See Also:
Constant Field Values
Constructor Detail

CardColor

public CardColor(int color)
Constructor for objects of class SetColor. Colors must be SetColor.RED, SetColor.GREEN or CardColor.BLUE. These colors are adjacent int values between getFirst() and getLast() inclusive.

Method Detail

equals

public boolean equals(Object o)
Returns true if and only if this object represents the same color as o

Overrides:
equals in class Object
Returns:
True if and only if this object represents the same color as o

getFirst

public static int getFirst()

getLast

public static int getLast()

getScreenColor

public Color getScreenColor()
Returns a graphical color object corresponding the to color of this object.

Returns:
The color of this object for use with Graphics operations.

toString

public String toString()
Returns simple text giving the color in English.

Overrides:
toString in class Object
Returns:
The color in English.