Class CalculationState


  • public class CalculationState
    extends java.lang.Object
    CalculationState class uses to count the total players for each state.
    Since:
    2019-04-19
    Version:
    1.0
    Author:
    Liew Sin Hui
    • Constructor Summary

      Constructors 
      Constructor Description
      CalculationState()  
      CalculationState​(int grandTotal, int sumGrandTotal)
      This constructs a player statistic with a specified grandTotal and sumGrandTotal
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void calculateTotal​(java.util.Vector<java.lang.Integer> a)
      calculateTotal method is count the total players for each state
      void catState​(java.lang.String states, java.lang.String cat, int total)
      catState method will get information about the player statistic with a specified states, cat and total
      java.lang.String getCat()
      get category name
      int getGrandTotal()
      get total players for each state.
      java.lang.String getStates()
      get state name
      int getSumGrandTotal()
      get total of all players
      int getTotal()
      get total players for each state by category
      void printFinalResult​(int sumGrandTotal)  
      void printGrandTotal()  
      void printResult()  
      • Methods inherited from class java.lang.Object

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

      • CalculationState

        public CalculationState()
      • CalculationState

        public CalculationState​(int grandTotal,
                                int sumGrandTotal)
        This constructs a player statistic with a specified grandTotal and sumGrandTotal
        Parameters:
        grandTotal - an initial for total players for each state.
        sumGrandTotal - an initial for count all the players.
    • Method Detail

      • catState

        public void catState​(java.lang.String states,
                             java.lang.String cat,
                             int total)
        catState method will get information about the player statistic with a specified states, cat and total
        Parameters:
        states - name of states
        cat - name of category
        total - total players for each state by category from current validTableLink
      • getCat

        public java.lang.String getCat()
        get category name
        Returns:
        category name
      • getStates

        public java.lang.String getStates()
        get state name
        Returns:
        state name
      • getTotal

        public int getTotal()
        get total players for each state by category
        Returns:
        total players for each state by category.
      • getGrandTotal

        public int getGrandTotal()
        get total players for each state.
        Returns:
        total players for each state.
      • getSumGrandTotal

        public int getSumGrandTotal()
        get total of all players
        Returns:
        total of all players
      • calculateTotal

        public void calculateTotal​(java.util.Vector<java.lang.Integer> a)
        calculateTotal method is count the total players for each state
        Parameters:
        a - the total players for each state by category from current validTableLink.
      • printResult

        public void printResult()
      • printGrandTotal

        public void printGrandTotal()
      • printFinalResult

        public void printFinalResult​(int sumGrandTotal)