ITimer.java 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /** Copyright (c) 2012-2015 committers of YAKINDU and others.
  2. All rights reserved. This program and the accompanying materials
  3. are made available under the terms of the Eclipse Public License v1.0
  4. which accompanies this distribution, and is available at
  5. http://www.eclipse.org/legal/epl-v10.html
  6. Contributors:
  7. committers of YAKINDU - initial API and implementation
  8. � */
  9. package traffic.light;
  10. /**
  11. * Interface a timer has to implement. Use to implement your own timer
  12. * service.
  13. *
  14. */
  15. public interface ITimer {
  16. /**
  17. * Starts the timing for a given time event id.
  18. *
  19. * @param callback
  20. * : The target callback where the time event has to be raised.
  21. *
  22. * @param eventID
  23. * : The eventID the timer should use if timed out.
  24. *
  25. * @param time
  26. * : Time in milliseconds after the given time event should be
  27. * triggered
  28. *
  29. * @param isPeriodic
  30. * : Set to true if the time event should be triggered periodically
  31. */
  32. public void setTimer(ITimerCallback callback, int eventID, long time, boolean isPeriodic);
  33. /**
  34. * Unset a time event.
  35. *
  36. * @param callback
  37. * : The target callback for which the time event has to be unset.
  38. *
  39. * @param eventID
  40. * : The time event id.
  41. */
  42. public void unsetTimer(ITimerCallback callback, int eventID);
  43. }