|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprogram4.Card
program4.GoFishCard
public class GoFishCard
Title: The GoFishCard Class
Description: Defines the properties and behaviors of a GoFishcard.
Copyright: Copyright (c) 2010
Constructor Summary | |
---|---|
GoFishCard()
Default Constructor |
|
GoFishCard(int n)
Constructor |
|
GoFishCard(int r,
int s)
Constructor |
Method Summary | |
---|---|
int |
compareTo(GoFishCard otherCard)
|
static int |
convertToRank(java.lang.String str)
A static method that converts a string to a card's equivalent rank |
boolean |
equals(GoFishCard otherCard)
|
boolean |
equals(java.lang.Object otherCard)
|
Methods inherited from class program4.Card |
---|
compareByRank, compareBySuit, equals, getRank, getRankAsString, getSuit, getSuitAsString, setRank, setSuit, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GoFishCard()
public GoFishCard(int n)
n
- a number between 0 and 51 inclusivepublic GoFishCard(int r, int s)
r
- - a rank (0 to 12) representing the Card's ranks
- - a suit (0 to 3) representing the Card's suitMethod Detail |
---|
public int compareTo(GoFishCard otherCard)
compareTo
in interface java.lang.Comparable<GoFishCard>
otherCard
- - a GoFishCard
public boolean equals(GoFishCard otherCard)
otherCard
- - a GoFishCard
public boolean equals(java.lang.Object otherCard)
equals
in class java.lang.Object
otherCard
- an Object
public static int convertToRank(java.lang.String str)
str
- - "2", "3", "4", "5", "6", "7", "8", "9", "10", "J","Q", "K", "A"
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |