Back to project page misty.
The source code is released under:
MIT License
If you think the Android project misty listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.misty.kernel; //from w ww . j av a 2 s .com public class Alarm { public final int id; private final OnAlarmRing listener; private final long time; private float total = 0; public Alarm(int id, OnAlarmRing listener, long time) { this.id = id; this.listener = listener; this.time = time; this.total = 0; } public boolean step(float delta) { boolean remove = false; this.total += (delta * 1E3f); if (this.total >= this.time) { remove = (!this.listener.onAlarmRing()); this.total -= this.time; } return remove; } public interface OnAlarmRing { public boolean onAlarmRing(); } }