Class ZetCard

java.lang.Object
  extended byCard
      extended byZetCard
All Implemented Interfaces:
java.lang.Comparable

public class ZetCard
extends Card

Represents a card for the game of Set. A card has four attributes: number: (1, 2, or 3), shape: (oval, squiggle, or diamond), fill (outlined, solid, or striped), and color (red, green, or blue). Each attribute is represented by an integer code from 1 to 3.


Constructor Summary
ZetCard(int n, int s, int f, int c)
          Constructs a Set game card with given attributes.
 
Method Summary
 int getColor()
          Returns this card's color code: 1 for red, 2 for green, 3 for blue.
 int getFill()
          Returns this card's fill code: 1 for outlined, 2 for solid, 3 for striped.
 int getNumber()
          Returns the number of symbols on this card.
 int getShape()
          Returns this card's shape code: 1 for oval, 2 for squiggle, 3 for diamond.
 java.lang.String toString()
          Returns a String representation of this card.
 
Methods inherited from class Card
compareTo, equals, getId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZetCard

public ZetCard(int n,
               int s,
               int f,
               int c)
Constructs a Set game card with given attributes.

Parameters:
n - number
s - shape
f - fill
c - color
Method Detail

getNumber

public int getNumber()
Returns the number of symbols on this card.

Returns:
the number of symbols on this card.

getShape

public int getShape()
Returns this card's shape code: 1 for oval, 2 for squiggle, 3 for diamond.

Returns:
this card's shape code.

getFill

public int getFill()
Returns this card's fill code: 1 for outlined, 2 for solid, 3 for striped.

Returns:
this card's fill code.

getColor

public int getColor()
Returns this card's color code: 1 for red, 2 for green, 3 for blue.

Returns:
this card's color code.

toString

public java.lang.String toString()
Returns a String representation of this card.

Overrides:
toString in class Card
Returns:
a String representation of this card.