|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.kosi.model.game.Bid | +--de.kosi.model.game.SuitBid
This class represents a suit bid. There are 35 different suit bids
possible. Since every possible suit bid instance is needed exactly
one time this class provides an array constant which contains all
these possible suit bids.
This class implements the Comparable interface to make it possible
to decide which suit bid is higher.
ChangeLog:
$Log: SuitBid.java,v $ Revision 1.1.1.1 2001/04/29 18:05:18 jiriki Imported sources from zola. Revision 1.7 2001/03/29 21:01:04 wombat - Improved logging. - Removed bugs from StressClient Revision 1.6 2001/03/21 13:26:36 wombat - Removed bugs in Table - began implementation of stree client - updated documentation Revision 1.5 2001/03/18 17:32:04 wombat Changed database concept Revision 1.4 2001/02/09 19:26:33 login Doc-Update Revision 1.3 2001/02/07 10:28:53 login Updated documentation!!!! Revision 1.2 2001/02/06 14:37:09 login Updated docs
Field Summary | |
static int |
NUM_LEVELS
This constant specifies the total number of bidding levels. |
static int |
NUM_SUIT_BIDS
This constant specifies the total number of different suit bids. |
static int |
NUM_SUITS
This constant specifies the number of different suits. |
static SuitBid[] |
SUIT_BIDS
This array constant stores all possible different SuitBid instances. |
static int |
SUIT_CLUBS
This constant refers to the clubs suit. |
static int |
SUIT_DIAMONDS
This constant refers to the diamonds suit. |
static int |
SUIT_HEARTS
This constant refers to the hearts suit. |
static int |
SUIT_NO_TRUMPS
This constant refers to the no trumps suit which is actually no suit but we treat it as one to make things easier. |
static int |
SUIT_SPADES
This constant refers to the spades suit. |
static java.lang.String[] |
SUIT_STRINGS
String Representation of the suits. |
Constructor Summary | |
protected |
SuitBid()
Creates a new SuitBid instance with illegal value. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this instance to the given argument. |
boolean |
equals(java.lang.Object obj)
Checks whether this instance and the given argument are equal. |
int |
getLevel()
Returns the level of this SuitBid instance. |
int |
getSuit()
Returns the suit of this SuitBid instance. |
static SuitBid |
getSuitBid(int value)
This method returns the SuitBid stored in the SUIT_BIDS array constant at the given index. |
static SuitBid |
getSuitBid(int suit,
int level)
This method returns the SuitBid instance with the given suit and level. |
int |
hashCode()
Returns a hash code for this SuitBid instance. |
java.lang.String |
toString()
Returns a String representation of this bid. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String[] SUIT_STRINGS
public static final int NUM_SUITS
public static final int NUM_LEVELS
public static final int NUM_SUIT_BIDS
public static final int SUIT_NO_TRUMPS
public static final int SUIT_SPADES
public static final int SUIT_HEARTS
public static final int SUIT_DIAMONDS
public static final int SUIT_CLUBS
public static SuitBid[] SUIT_BIDS
Constructor Detail |
protected SuitBid()
Method Detail |
public static SuitBid getSuitBid(int value)
value
- The index to the returned SuitBid.public static SuitBid getSuitBid(int suit, int level)
suit
- The suit of the desired SuitBid.level
- The level of the desired SuitBid.java.lang.IllegalArgumentException
- If the given suit or level
were invalid.public int getLevel()
public int getSuit()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The argument to compare to this instance.public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- The argument to compare to this instance.ClassCastException
- If the given argument wasn't an
instance of SuitBid.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |