|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.applib.clock.Clock
public abstract class Clock
Provides a mechanism to get (and possible to set) the current time.
The clock is used primarily by the temporal value classes, and is accessed by the NOF as a singleton. The actual implementation used can be configured at startup, but once specified the clock instance cannot be changed.
Unless another Clock implementation has been installed, the first call to getInstance()
will instantiate an implementation that just uses the system's own clock. Alternate implementations can be
created via suitable subclasses, but this must be done before the first call to getInstance().
See for example getInstance().
| Constructor Summary | |
|---|---|
protected |
Clock()
|
| Method Summary | |
|---|---|
static Clock |
getInstance()
Returns the (singleton) instance of Clock. |
static long |
getTime()
|
static Calendar |
getTimeAsCalendar()
|
static boolean |
isInitialized()
Whether has been initialized or not. |
protected static boolean |
remove()
Allows subclasses to remove their implementation. |
protected abstract long |
time()
The current time since midnight, January 1, 1970 UTC. |
Calendar |
timeAsCalendar()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Clock()
| Method Detail |
|---|
public static final Clock getInstance()
Clock.
Unless it has been otherwise created, will lazily instantiate an
implementation that just delegate to the computer's own system clock
(as per System.currentTimeMillis().
public static boolean isInitialized()
public static long getTime()
public static Calendar getTimeAsCalendar()
protected static boolean remove()
public final Calendar timeAsCalendar()
protected abstract long time()
Measured in milliseconds, modeled after (and possibly implemented by)
System.currentTimeMillis().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||