Package com.cheetahdigital.uikit.helper
Class Countdown
- java.lang.Object
-
- com.cheetahdigital.uikit.helper.Countdown
-
public class Countdown extends java.lang.Object
Helper class for counting down a number of items, can be used for doing multiple tasks and you want to be notified that the tasks were already finished or aborted.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Countdown.AbortListener
Callback used when countdown is aborted.static interface
Countdown.FinishListener
Callback used when countdown has ended.
-
Constructor Summary
Constructors Constructor Description Countdown(int count, Countdown.FinishListener finishListener)
Countdown(int count, Countdown.FinishListener finishListener, Countdown.AbortListener abortListener)
Constructor forCountdown
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
Aborts the currentCountdown
, signaling the Listener with the current countvoid
countDown()
Count down once, signalsCountdown.FinishListener
when count reaches zero.
-
-
-
Constructor Detail
-
Countdown
public Countdown(int count, Countdown.FinishListener finishListener)
-
Countdown
public Countdown(int count, Countdown.FinishListener finishListener, Countdown.AbortListener abortListener)
Constructor forCountdown
.- Parameters:
count
- number of itemsfinishListener
- callback to handle the resultsabortListener
- callback to handle the results
-
-
Method Detail
-
countDown
public void countDown()
Count down once, signalsCountdown.FinishListener
when count reaches zero.
-
abort
public void abort()
Aborts the currentCountdown
, signaling the Listener with the current count
-
-