|
Field Summary | ||
static Duration |
DAY | |
static Duration |
MONTH | |
static Duration |
QUARTER | |
static Duration |
SIX_MONTHS | |
static Duration |
TWO_WEEKS | |
static Duration |
WEEK | |
static String |
XML_DAY | |
static String |
XML_MONTH | |
static String |
XML_QUARTER | |
static String |
XML_SIX_MONTHS | |
static String |
XML_TWO_WEEKS | |
static String |
XML_WEEK | |
static String |
XML_YEAR | |
static Duration |
YEAR |
Constructor Summary | ||
Duration() Constructor for Duration - a zero value duration |
||
Duration(boolean positive_in, long months_in, long seconds_in, long nanos_in) Construct a duration from months seconds and nanos Checks sign and fixes up seconds and nano. |
||
Duration(String duration) Construct a Duration from the XMLSchema definition |
||
Duration(String start, String end) Create a duration betweeen two dates expressed as strings. |
||
Duration(Date date) Create a duration given a date. |
||
Duration(Date start_in, Date end_in) Construct a preiod between the two given dates |
Method Summary | ||
static Date |
add(Date date, Duration duration) Add a duration to a date and return the date plus the specified increment. |
|
add(Duration add) Add two durations together |
||
int |
compareTo(Object o) Compare two durations |
|
divide(int d) Divide the duration - if year-month drops the day-second part of the duration |
||
boolean |
equals(Object o) | |
formattedString() Format in human readable form TODO: I18n |
||
getDayToYear() Extract the day to sec part. |
||
getYearToMonth() Extract the year to month part |
||
int |
hashCode() | |
boolean |
hasTime() Check if it includes time |
|
boolean |
isDayToSec() Check if is day-sec |
|
boolean |
isYearToMonth() Check if is year-month |
|
largestComponentformattedString() | ||
static void |
main(String[] args) TODO: Tests that should be moved into a unit test |
|
static Date |
subtract(Date date, Duration duration) Subtract a period for a given date |
|
subtract(Duration sub) Subtract one duration from another |
||
toString() Produce the XML Schema string |
||
unaryMinus() Negate the duration |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
|