1
2
3
4
5
6
7
8
9
10
11 package de.jaret.util.date.timemachine;
12
13 /***
14 * Singleton to provide a time machine. The time machine will be setup to begin with the current time.
15 * Do your setup early in your application setup if you want a special starting time or a real time provider.
16 *
17 * @author kliem
18 * @version $Id: TimeMachineSingleton.java 702 2007-12-30 11:54:55Z kliem $
19 */
20 public class TimeMachineSingleton {
21 /*** the time machine instance. */
22 private static TimeMachine _instance = new TimeMachine(System.currentTimeMillis());
23
24
25 /***
26 * Retrieve the time provider instance.
27 * @return time provider to be used
28 */
29 public static ITimeProvider getTimeProvider() {
30 return _instance;
31 }
32
33 /***
34 * Retrieve the time machine for configuration etc.
35 * @return the time machien instance
36 */
37 public static TimeMachine getTimeMachine() {
38 return _instance;
39 }
40
41
42 }