|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.kosi.model.Rubber
This class provides mechanisms for rubber-scoring.
ChangeLog:
$Log: Rubber.java,v $ Revision 1.3 2001/07/04 12:17:12 uid51247 now the rubber valuations are available to the clients Revision 1.2 2001/06/27 11:53:20 betacarotine Worked on the Rubber and added comments. Revision 1.1 2001/06/22 14:16:51 betacarotine Startet implementing a rubber valuation
Field Summary | |
static int |
EAST_WEST
This constant refers the pair seated at east/west direction. |
static int |
NORTH_SOUTH
This constant refers the pair seated at north/south direction. |
static int |
NUM_GAMES
The maximum number of games in a rubber. |
static int |
NUM_PAIRS
The number of pairs playing a rubber. |
Constructor Summary | |
Rubber()
Creates a new rubber. |
|
Rubber(Result result)
|
Method Summary | |
int |
gamesWonBy(int pair)
Returns the number of games that were won by the given pair. |
int |
getCurrentGame()
Returns the current game in a rubber. |
int |
getGameScore(int pair,
int game)
Returns the score in a rubber for the given pair in the given game. |
int |
getLoser()
|
int |
getPointsAbove(int pair)
Returns the points above the line in a rubber for the given pair. |
int |
getTotal(int pair)
Returns the total points in a rubber for the given pair. |
int |
getWinner()
|
boolean |
isFinished()
Returns whether the rubber is over or not. |
void |
update(Result result)
Updates the points above and below the line with the given result for both pairs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NUM_GAMES
public static final int NUM_PAIRS
public static final int NORTH_SOUTH
public static final int EAST_WEST
Constructor Detail |
public Rubber()
public Rubber(Result result)
Method Detail |
public int gamesWonBy(int pair)
pair
- The pair of which the number of won games is to be
returned.java.lang.IllegalArgumentException
- If the given argument was no
pair constant.public int getCurrentGame() throws RubberException
RubberException
- If the Rubber is already over.public int getPointsAbove(int pair)
pair
- The pair from which to return the points above the line.ArrayIndexOutOfBoundsException
- If the given index was
invalid.public int getTotal(int pair)
pair
- The pair from which to return the total points.public int getGameScore(int pair, int game)
pair
- The pair from which to return the score in the given game.game
- The game from which to return the score for the given pair.ArrayIndexOutOfBoundsException
- If the given index was
invalid.public int getWinner() throws RubberException
public int getLoser() throws RubberException
public void update(Result result) throws RubberException
result
- The result to add to the rubber.RubberException
- If the Rubber is already over.public boolean isFinished()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |