|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object proj2.Suit
public class Suit
The Suit class defines each of the 4 suits of a standard deck of playing cards. Using this class assures that all code refers to the suits in the same manner i.e Suit.CLUBS, Suit.DIAMONDS, Suit.HEARTS, and Suit.SPADES with no possibility of conflicting representations
Class Invariant:
The Suit's symbol is a single alphabetic character
The Suit's name is a non-empty string
Suit objects are immutable and unique
Field Summary | |
---|---|
static Suit |
CLUBS
The suit CLUBS |
static Suit |
DIAMONDS
The suit DIAMONDS |
static Suit |
HEARTS
The suit HEARTS |
static Suit |
SPADES
The suit SPADES |
Method Summary | |
---|---|
boolean |
equals(Suit otherSuit)
Determines if two Suits are the same |
java.lang.String |
getName()
Accessor for the long name of the Suit |
java.lang.String |
getSymbol()
Accessor for the suit symbol |
static Suit[] |
VALUES()
VALUES A method to return all suits |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Suit CLUBS
public static final Suit DIAMONDS
public static final Suit HEARTS
public static final Suit SPADES
Method Detail |
---|
public static Suit[] VALUES()
public java.lang.String getSymbol()
public java.lang.String getName()
public boolean equals(Suit otherSuit)
otherSuit
- - the suit to compare for equality
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |