Class CardShape

java.lang.Object
  |
  +--CardShape

public class CardShape
extends Object

CardShape stores a shape used by the Set game.

Version:
1.0
Author:
Francis Torralba

Field Summary
static int CIRCLE
           
static int DIAMOND
           
static int SQUIGGLE
           
 
Constructor Summary
CardShape(int shape)
          Constructor for objects of class SetShape.
 
Method Summary
 boolean equals(Object o)
          Returns true if and only if this object represents the same shape as o
static int getFirst()
           
static int getLast()
           
 Shape getScreenShape()
          Returns a graphical color object corresponding the to color of this object.
 int toInt()
           
 String toString()
          Returns shape in English.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CIRCLE

public static final int CIRCLE
See Also:
Constant Field Values

DIAMOND

public static final int DIAMOND
See Also:
Constant Field Values

SQUIGGLE

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

CardShape

public CardShape(int shape)
Constructor for objects of class SetShape. Shapes must be SetShape.CIRCLE, SetShape.SQUIGGLE or CardShape.DIAMOND. These shapes 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 shape as o

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

getFirst

public static int getFirst()

getLast

public static int getLast()

getScreenShape

public Shape getScreenShape()
Returns a graphical color object corresponding the to color of this object.

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

toInt

public int toInt()

toString

public String toString()
Returns shape in English.

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