|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.anasoft.os.daofusion.bitemporal.TimeUtils
public final class TimeUtils
Static utilities dealing with time.
This class controls the record time using a ReferenceTimeProvider
.
You can override the default ThreadLocalReferenceProvider
implementation by calling the setReferenceProvider
method upon application startup.
ReferenceTimeProvider
Field Summary | |
---|---|
static long |
ACTUAL_END_OF_TIME
Timestamp value that represents N/A date. |
static long |
END_OF_TIME
|
Method Summary | |
---|---|
static void |
clearReference()
Clears the reference time. |
static org.joda.time.DateTime |
current()
Returns the current local time (wallclock now), ignoring the reference time. |
static org.joda.time.DateTime |
day(int day,
int month,
int year)
Create a DateTime object representing given day of given month
in given year. |
static org.joda.time.DateTime |
endOfTime()
Returns a DateTime object representing the end of time. |
static org.joda.time.Interval |
from(org.joda.time.DateTime start)
Returns an interval running from given start time till the end of time. |
static org.joda.time.Interval |
fromNow()
Returns an interval running from now till the end of time. |
static org.joda.time.Interval |
interval(org.joda.time.DateTime start,
org.joda.time.DateTime end)
Returns a interval running for the specified period. |
static boolean |
isReferenceSet()
Determines whether or not a reference time has been set. |
static org.joda.time.DateTime |
now()
Returns the current reference time. |
static org.joda.time.DateTime |
reference()
Returns the reference time, or wallclock now if no reference time has been set. |
static void |
setReference(org.joda.time.DateTime dateTime)
Set the reference time to the specified value. |
static void |
setReferenceProvider(ReferenceTimeProvider provider)
Overrides the default ReferenceTimeProvider implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long ACTUAL_END_OF_TIME
public static final long END_OF_TIME
Method Detail |
---|
public static void setReferenceProvider(ReferenceTimeProvider provider)
ReferenceTimeProvider
implementation.
public static boolean isReferenceSet()
public static org.joda.time.DateTime reference()
public static void setReference(org.joda.time.DateTime dateTime)
public static void clearReference()
public static org.joda.time.DateTime day(int day, int month, int year)
DateTime
object representing given day of given month
in given year.
public static org.joda.time.DateTime now()
reference()
public static org.joda.time.DateTime current()
public static org.joda.time.DateTime endOfTime()
DateTime
object representing the end of time.
public static org.joda.time.Interval interval(org.joda.time.DateTime start, org.joda.time.DateTime end)
public static org.joda.time.Interval from(org.joda.time.DateTime start)
endOfTime()
public static org.joda.time.Interval fromNow()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |