All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.lotspiech.poker.Card

java.lang.Object
   |
   +----com.lotspiech.poker.Card

public class Card
extends Object
implements Serializable
This class represents a single card.

Copyright 2001, 2002 by Jeffrey B. Lotspiech. This program is open source; it is licensed under the Common Public License Version 0.5.

Author:
Jeffrey B. Lotspiech

Variable Index

 o ACE
 o cardRank
 o cardSuit
 o CLUB
 o COPYRIGHT
 o DIAMOND
 o EIGHT
 o FIVE
 o FOUR
 o HEART
 o JACK
 o JOKER
 o KING
 o NINE
 o NO_WILD_RANK
The idea is that a wild rank, (e.g., deuces wild), is implemented by moving the ranks from the original index to the "WILD_RANK" index.
 o QUEEN
 o RANK_STRING
 o SEVEN
 o SIX
 o SPADE
 o SUIT_STRING
 o TEN
 o THREE
 o TWO
 o wild
 o WILD_RANK

Constructor Index

 o Card(int)
 o Card(int, int)
 o Card(String)

Method Index

 o equals(Card)
 o isWild()
Is this card wild? This question can only be asked in the context of a given Machine.
 o rank()
 o setWild()
Sets a card "wild" in a given situation.
 o suit()
 o toString()

Variables

 o COPYRIGHT
 private static final String COPYRIGHT
 o JOKER
 public static final int JOKER
 o ACE
 public static final int ACE
 o KING
 public static final int KING
 o QUEEN
 public static final int QUEEN
 o JACK
 public static final int JACK
 o TEN
 public static final int TEN
 o NINE
 public static final int NINE
 o EIGHT
 public static final int EIGHT
 o SEVEN
 public static final int SEVEN
 o SIX
 public static final int SIX
 o FIVE
 public static final int FIVE
 o FOUR
 public static final int FOUR
 o THREE
 public static final int THREE
 o TWO
 public static final int TWO
 o NO_WILD_RANK
 public static final int NO_WILD_RANK
The idea is that a wild rank, (e.g., deuces wild), is implemented by moving the ranks from the original index to the "WILD_RANK" index.

 o WILD_RANK
 public static final int WILD_RANK
 o RANK_STRING
 public static final String RANK_STRING
 o SPADE
 public static final int SPADE
 o HEART
 public static final int HEART
 o DIAMOND
 public static final int DIAMOND
 o CLUB
 public static final int CLUB
 o SUIT_STRING
 public static final String SUIT_STRING
 o cardRank
 private int cardRank
 o cardSuit
 private int cardSuit
 o wild
 boolean wild

Constructors

 o Card
 public Card(int i)
 o Card
 public Card(int cardSuit,
             int cardRank)
Parameters:
cardSuit - Card.SPADE, Card.HEART, etc.
cardRank - Card.ACE, Card.NINE, etc.
 o Card
 public Card(String name) throws Exception

Methods

 o equals
 public boolean equals(Card c)
 o isWild
 public boolean isWild()
Is this card wild? This question can only be asked in the context of a given Machine. The card will have to have been "setWild()" by Machine.makeHand(), for example.

Returns:
true if wild.
 o rank
 public int rank()
 o setWild
 public void setWild()
Sets a card "wild" in a given situation.

 o suit
 public int suit()
 o toString
 public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index