|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jopendocument.util.TimeUtils
public class TimeUtils
| Nested Class Summary | |
|---|---|
static class |
TimeUtils.DurationNullsBuilder
|
static class |
TimeUtils.DurationNullsChanger
Allow to change empty fields between two equivalent state. |
static class |
TimeUtils.EmptyFieldPolicy
|
| Constructor Summary | |
|---|---|
TimeUtils()
|
|
| Method Summary | |
|---|---|
static Calendar |
copyLocalTime(Calendar from,
Calendar to)
Copy the local time from one calendar to another. |
static List<DatatypeConstants.Field> |
getAllFields()
|
static List<DatatypeConstants.Field> |
getDateFields()
Get the fields for the date part. |
static BigDecimal |
getSeconds(Duration d)
Get non-null seconds with the the correct class. |
static List<DatatypeConstants.Field> |
getTimeFields()
Get the fields for the time part. |
static DatatypeFactory |
getTypeFactory()
|
static long |
normalizeLocalTime(Calendar cal)
Normalize cal so that any Calendar with the same local time have the same
result. |
static Duration |
removeNulls(Duration dur)
|
static Duration |
timePartToDuration(Calendar cal)
Convert the time part of a calendar to a duration. |
static Duration |
trimDuration(Duration dur)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TimeUtils()
| Method Detail |
|---|
public static List<DatatypeConstants.Field> getAllFields()
public static List<DatatypeConstants.Field> getDateFields()
DatatypeConstants.DAYS included.public static List<DatatypeConstants.Field> getTimeFields()
DatatypeConstants.HOURS.public static final DatatypeFactory getTypeFactory()
public static final BigDecimal getSeconds(Duration d)
d - a duration.
null.Duration.getField(javax.xml.datatype.DatatypeConstants.Field),
Duration.getMinutes()public static final Duration timePartToDuration(Calendar cal)
cal - a calendar, e.g. 23/12/2011 11:55:33.066 GMT+02.
public static final Duration trimDuration(Duration dur)
public static final Duration removeNulls(Duration dur)
public static final long normalizeLocalTime(Calendar cal)
cal so that any Calendar with the same local time have the same
result. If you don't need a Calendar this is faster than
copyLocalTime(Calendar, Calendar).
cal - a calendar, e.g. 0:00 CEST.
public static final Calendar copyLocalTime(Calendar from,
Calendar to)
throws IllegalArgumentException
NOTE : In case the two calendars are not from the same class but one of them is a
GregorianCalendar then this method will use a GregorianCalendar with the time zone
and absolute time of the other.
from - the source calendar, e.g. 23/12/2011 11:55:33.066 GMT-12.to - the destination calendar, e.g. 01/01/2000 0:00 GMT+13.
IllegalArgumentException - if both calendars aren't from the same class and none of
them are Gregorian.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||