Package fi.sportti.app.ui.utilities
Class CounterUtility
- java.lang.Object
-
- fi.sportti.app.ui.utilities.CounterUtility
-
public class CounterUtility extends java.lang.Object
Counter utility for getting user input from our pop ups
-
-
Constructor Summary
Constructors Constructor Description CounterUtility()
Constructor if developer wants counter with default valuesCounterUtility(int min, int max, int start, int step)
Constructor if developer wants counter with custom valuesCounterUtility(int min, int max, int start, int step, boolean roll)
Constructor if developer wants rolling counter with custom values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToCounter()
Adds step amount to countervoid
addToCounter(int i)
Adds amount of inputted value to countervoid
minusToCounter()
Removes step amount to countervoid
minusToCounter(int i)
Removes amount of inputted value to countervoid
resetCounter()
Resets counter to defined starting valuejava.lang.String
returnCounter()
Returns counter value in stringint
returnCounterInt()
Returns counter value in integer
-
-
-
Constructor Detail
-
CounterUtility
public CounterUtility(int min, int max, int start, int step, boolean roll)
Constructor if developer wants rolling counter with custom values- Parameters:
min
- Minimum value for countermax
- Maximum value for counterstart
- Value where the counter will startstep
- Value of how big will the default step beroll
- Boolean to determine if user wants rolling counter
-
CounterUtility
public CounterUtility(int min, int max, int start, int step)
Constructor if developer wants counter with custom values- Parameters:
min
- Minimum value for countermax
- Maximum value for counterstart
- Value where the counter will startstep
- Value of how big will the default step be
-
CounterUtility
public CounterUtility()
Constructor if developer wants counter with default values
-
-
Method Detail
-
returnCounter
public java.lang.String returnCounter()
Returns counter value in string- Returns:
- Counter value in string
-
returnCounterInt
public int returnCounterInt()
Returns counter value in integer- Returns:
- Counter value in integer
-
addToCounter
public void addToCounter()
Adds step amount to counter
-
addToCounter
public void addToCounter(int i)
Adds amount of inputted value to counter- Parameters:
i
- Value of how much to add
-
minusToCounter
public void minusToCounter()
Removes step amount to counter
-
minusToCounter
public void minusToCounter(int i)
Removes amount of inputted value to counter- Parameters:
i
- Value of how much to remove
-
resetCounter
public void resetCounter()
Resets counter to defined starting value
-
-