Package com.groupProject
Class CalculationState
- java.lang.Object
-
- com.groupProject.CalculationState
-
public class CalculationState extends java.lang.ObjectCalculationState 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 voidcalculateTotal(java.util.Vector<java.lang.Integer> a)calculateTotal method is count the total players for each statevoidcatState(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 totaljava.lang.StringgetCat()get category nameintgetGrandTotal()get total players for each state.java.lang.StringgetStates()get state nameintgetSumGrandTotal()get total of all playersintgetTotal()get total players for each state by categoryvoidprintFinalResult(int sumGrandTotal)voidprintGrandTotal()voidprintResult()
-
-
-
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 statescat- name of categorytotal- 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)
-
-