|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--GroupOfThree
GroupOfThree represents a group of three Card objects. The order of the cards is not significant.
Constructor Summary | |
GroupOfThree()
Constructor for objects of class GroupOfThree |
Method Summary | |
void |
addCard(Card c)
Adds a card to the group. |
boolean |
colorSet()
Returns true if and only if there are three cards in the group, and the group forms a valid set. |
Card |
getCard(int whichCard)
Returns a specified card from the group. |
boolean |
hasCard(Card c)
Returns true if and only if the Card is in the group. |
boolean |
isSet()
Determines if the group is a set. |
boolean |
numberSet()
Determines if the group has valid numbers (e.g., 1,2,3 or 1,1,1, etc.). |
void |
removeCard(Card c)
Removes the card from the group. |
boolean |
shadingSet()
Determines if the group has valid shadings. |
boolean |
shapeSet()
Determines if the group has valid shapes. |
String |
toString()
Returns a string representation of the group. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GroupOfThree()
Method Detail |
public void addCard(Card c)
c
- The card to be addedpublic boolean colorSet()
public Card getCard(int whichCard)
whichCard
- Either 1, 2, or 3.
public boolean hasCard(Card c)
c
- The card to look for.
public boolean isSet()
public boolean numberSet()
public void removeCard(Card c)
c
- The card to be removed.public boolean shadingSet()
public boolean shapeSet()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |