Class CardSuit

java.lang.Object
  |
  +--CardSuit

public class CardSuit
extends java.lang.Object

CardSuit.java An object to represent the suit of a playing card.

Version:
4/6/01
Author:
Grant William Braught

Field Summary
static boolean BLACK
          A Black suit.
static char CLUBS
          The Clubs suit.
static char DIAMONDS
          The Diamonds suit.
static char HEARTS
          The Hearts suit.
static boolean RED
          A Red suit.
static char SPADES
          The Spades suit.
 
Constructor Summary
CardSuit(char initSuit)
          Construct a CardSuit and initialize the suit.
 
Method Summary
 boolean equals(CardSuit compSuit)
          Compare the suit of of the invoking object to the suit of compSuit.
 boolean getColor()
          Return the color of the Suit of the invoking Suit object.
 char getSuit()
          Return the suit of the CardSuit object.
 java.lang.String toString()
          Return a String representation of the CardSuit.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLACK

public static final boolean BLACK
A Black suit.

CLUBS

public static final char CLUBS
The Clubs suit.

DIAMONDS

public static final char DIAMONDS
The Diamonds suit.

HEARTS

public static final char HEARTS
The Hearts suit.

RED

public static final boolean RED
A Red suit.

SPADES

public static final char SPADES
The Spades suit.
Constructor Detail

CardSuit

public CardSuit(char initSuit)
Construct a CardSuit and initialize the suit.
Parameters:
initSuit - the suit for the CardSuit.
Method Detail

equals

public boolean equals(CardSuit compSuit)
Compare the suit of of the invoking object to the suit of compSuit.
Parameters:
compSuit - the CardSuit to compare to.
Returns:
true if the suit of the invoking object is the same as the suit of compSuit, and false if they are not.

getColor

public boolean getColor()
Return the color of the Suit of the invoking Suit object.
Returns:
the color of the suit of the invoking object.

getSuit

public char getSuit()
Return the suit of the CardSuit object.
Returns:
the suit of the CardSuit object.

toString

public java.lang.String toString()
Return a String representation of the CardSuit.
Overrides:
toString in class java.lang.Object
Returns:
a String representation of the CardSuit.