Class GameStatistics


  • public class GameStatistics
    extends java.lang.Object
    This class holds all necessary information, that might be shown on the StatisticGraph.
    • 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 dealer
      int getMaxRound()
      returns maximum roundNumber
      int getMinimum()
      returns lowest-account-status of either a player or the dealer
      java.util.Iterator getPlayers()
      return all the player-names
      int[] getXArray​(Player player)
      returns an array with roundNumbers, either of an player or of the dealer
      int[] getYArray​(Player player)
      returns an array with account-stati, either of an player or of the dealer
      boolean 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GameStatistics

        public GameStatistics()
        The constructor initialises the class-variables
    • 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.