com.openholdem.structs
Class Card

java.lang.Object
  extended by com.openholdem.structs.Card
All Implemented Interfaces:
ICard, java.lang.Comparable

public class Card
extends java.lang.Object
implements ICard, java.lang.Comparable

Version:
$Revision: 1.4 $

A card is one of the 52 cards in the Deck.

Author:
mattmann

Field Summary
static java.lang.String ANY_SUIT
           
static java.lang.String SUIT_CLUBS
           
static java.lang.String SUIT_DIAMONDS
           
static java.lang.String SUIT_HEARTS
           
static java.lang.String SUIT_SPADES
           
 
Constructor Summary
Card()
          Construct a new Card
Card(java.lang.String suit, java.lang.String card)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare this Card to another Card
 boolean equals(java.lang.Object o)
           
 java.lang.String getCard()
           
 int getCardSuitValue()
           
 int getCardValue()
           
 java.lang.String getSuit()
           
 int hashCode()
           
 void setFCard(java.lang.String card)
           
 void setFSuit(java.lang.String suit)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY_SUIT

public static final java.lang.String ANY_SUIT
See Also:
Constant Field Values

SUIT_CLUBS

public static final java.lang.String SUIT_CLUBS
See Also:
Constant Field Values

SUIT_HEARTS

public static final java.lang.String SUIT_HEARTS
See Also:
Constant Field Values

SUIT_SPADES

public static final java.lang.String SUIT_SPADES
See Also:
Constant Field Values

SUIT_DIAMONDS

public static final java.lang.String SUIT_DIAMONDS
See Also:
Constant Field Values
Constructor Detail

Card

public Card()

Construct a new Card


Card

public Card(java.lang.String suit,
            java.lang.String card)
Method Detail

getCard

public java.lang.String getCard()
Specified by:
getCard in interface ICard

getSuit

public java.lang.String getSuit()
Specified by:
getSuit in interface ICard

setFCard

public void setFCard(java.lang.String card)
Parameters:
card - The fCard to set.

setFSuit

public void setFSuit(java.lang.String suit)
Parameters:
suit - The fSuit to set.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException

Compare this Card to another Card

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The card to compare ourselves to.
Returns:
-1 if this Card is less than the param o, 0 if it is equal and 1 if it is greater
Throws:
java.lang.ClassCastException

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getCardValue

public int getCardValue()

getCardSuitValue

public int getCardSuitValue()


Copyright © 2005-2007 Pagemewhen.com. All Rights Reserved.