Package jadex.bdi.examples.blackjack
Class GameStatistics
- java.lang.Object
-
- jadex.bdi.examples.blackjack.GameStatistics
-
public class GameStatistics extends java.lang.Object
This class holds all necessary information, that might be shown on the StatisticGraph.
-
-
Field Summary
Fields Modifier and Type Field Description SimplePropertyChangeSupport
pcs
The helper object for bean events.
-
Constructor Summary
Constructors Constructor Description GameStatistics()
The constructor initialises the class-variables
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGameRound(Dealer dealer, Player[] players)
This method is called by the master plan whenever a game has finished.void
addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.int
getMaximum()
returns highest-account-status of either a player or the dealerint
getMaxRound()
returns maximum roundNumberint
getMinimum()
returns lowest-account-status of either a player or the dealerjava.util.Iterator
getPlayers()
return all the player-namesint[]
getXArray(Player player)
returns an array with roundNumbers, either of an player or of the dealerint[]
getYArray(Player player)
returns an array with account-stati, either of an player or of the dealerboolean
isDataAvailable()
Is statistical data available ?void
removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.void
setShowDealer(boolean show)
This method is called by the actionPerformed-method of the StatisticGraph-object.
-
-
-
Field Detail
-
pcs
public SimplePropertyChangeSupport pcs
The helper object for bean events.
-
-
Method Detail
-
setShowDealer
public void setShowDealer(boolean show)
This method is called by the actionPerformed-method of the StatisticGraph-object.
-
addGameRound
public void addGameRound(Dealer dealer, Player[] players)
This method is called by the master plan whenever a game has finished. The new data is added and the graph's minimum and maximum is recalculated.
-
getPlayers
public java.util.Iterator getPlayers()
return all the player-names
-
isDataAvailable
public boolean isDataAvailable()
Is statistical data available ?- Returns:
- flag indicating if data is available
-
getXArray
public int[] getXArray(Player player)
returns an array with roundNumbers, either of an player or of the dealer
-
getYArray
public int[] getYArray(Player player)
returns an array with account-stati, either of an player or of the dealer
-
getMaxRound
public int getMaxRound()
returns maximum roundNumber
-
getMaximum
public int getMaximum()
returns highest-account-status of either a player or the dealer
-
getMinimum
public int getMinimum()
returns lowest-account-status of either a player or the dealer
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.- Parameters:
listener
- The PropertyChangeListener to be added.
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.- Parameters:
listener
- The PropertyChangeListener to be removed.
-
-