ITimer.java 972 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package traffic.light;
  2. /**
  3. * Interface a timer has to implement. Use to implement your own timer
  4. * service.
  5. *
  6. */
  7. public interface ITimer {
  8. /**
  9. * Starts the timing for a given time event id.
  10. *
  11. * @param callback
  12. * : The target callback where the time event has to be raised.
  13. *
  14. * @param eventID
  15. * : The eventID the timer should use if timed out.
  16. *
  17. * @param time
  18. * : Time in milliseconds after the given time event should be
  19. * triggered
  20. *
  21. * @param isPeriodic
  22. * : Set to true if the time event should be triggered periodically
  23. */
  24. public void setTimer(ITimerCallback callback, int eventID, long time, boolean isPeriodic);
  25. /**
  26. * Unset a time event.
  27. *
  28. * @param callback
  29. * : The target callback for which the time event has to be unset.
  30. *
  31. * @param eventID
  32. * : The time event id.
  33. */
  34. public void unsetTimer(ITimerCallback callback, int eventID);
  35. }