ITimer.java 1.3 KB

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