Package com.cheetahdigital.uikit.helper
Class Countdown
- java.lang.Object
-
- com.cheetahdigital.uikit.helper.Countdown
-
public class Countdown extends java.lang.ObjectHelper 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 interfaceCountdown.AbortListenerCallback used when countdown is aborted.static interfaceCountdown.FinishListenerCallback 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 voidabort()Aborts the currentCountdown, signaling the Listener with the current countvoidcountDown()Count down once, signalsCountdown.FinishListenerwhen 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.FinishListenerwhen count reaches zero.
-
abort
public void abort()
Aborts the currentCountdown, signaling the Listener with the current count
-
-