|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcs4099.Card
public class Card
This class represents an individual playing card, which can have one of four suits and one of thirteen values.
Pile
Constructor Summary | |
---|---|
Card(int suit,
int value)
Creates a new instance of Card. |
Method Summary | |
---|---|
boolean |
equals(Card card)
Comparator method for cards. |
javax.swing.JLabel |
getCardImage()
A method that returns the image file that represents this card. |
javax.swing.JLabel |
getCardLabel()
Builds a JLabel illustrating this card's properties. |
java.lang.String |
toString()
Converts the data held in this card to string form for output. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Card(int suit, int value)
suit
- The suit of the card (0-3: 0 = Spades, 1 = Hearts, 2 = Clubs, 3 = Diamonds)value
- The value of the card (1-13)Method Detail |
---|
public boolean equals(Card card)
card
- The card to compare to
public java.lang.String toString()
toString
in class java.lang.Object
public javax.swing.JLabel getCardLabel()
public javax.swing.JLabel getCardImage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |