|
Oracle® Information Rights Management Server Java API Reference 11g Release 1 (11.1.1) E12907-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TimePeriod
A definition of a length of time. A time period stores a period of time as a numeric value and the time units - years, days, hours, minutes or seconds. A time period can have a positive or negative value - indicating the direction of the time period. A negative time period amount would mean that the time period is in the past, a positive time period would mean the time period is in the future.
Instances of Time Period objects can be created using the following factory style method(s).
TimePeriod object = createTimePeriod
(
amount,
units);
Collections for TimePeriod
objects can be created using the following factory method. This method creates the most appropriate collection implementation class for storing TimePeriod
elements.
Collection
<TimePeriod
> object =createTimePeriods
();
Time Period instances can be serialized as an XML document. This XML document can also be used to recreate a Time Period object. The following XML document shows an example Time Period in XML form.
<?xml version="1.0" encoding="UTF-8"?>
<core:TimePeriod xmlns:core="http://xmlns.oracle.com/irm/core">
<amount>30</amount>
<units>MINUTES</units>
</core:TimePeriod>
Nested Class Summary | |
---|---|
static class |
TimePeriod.Units Time units. |
Method Summary | |
---|---|
Date |
addToTime(Date dateTime) Add this time period to a date and time. |
int |
getAmount() The time period amount. |
TimePeriod.Units |
getUnits() Time units. |
Date |
startOfPeriod(Date dateTime) Work out the start of the specified period. |
long |
toSeconds() Convert this time period to seconds. |
Method Detail |
---|
int getAmount()
TimePeriod.Units getUnits()
Date addToTime(Date dateTime)
dateTime
- the date and time.Date startOfPeriod(Date dateTime)
dateTime
- the date and time.long toSeconds()
|
Oracle® Information Rights Management Server Java API Reference 11g Release 1 (11.1.1) E12907-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |