Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


oracle.irm.engine.types.core.time
Class TimePeriod

java.lang.Object
  extended by oracle.irm.engine.types.core.time.TimePeriod

All Implemented Interfaces:
Serializable

public class TimePeriod
extends Object
implements Serializable

Time Period type. 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.

XML Serialization

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>

See Also:
Serialized Form

Nested Class Summary
static class TimePeriod.Units
          Units enumeration.

 

Constructor Summary
TimePeriod()
          No argument constructor.
TimePeriod(int amount, TimePeriod.Units units)
          Constructor.

 

Method Summary
 int getAmount()
          The time period amount.
 TimePeriod.Units getUnits()
          Time units.
 void setAmount(int value)
          The time period amount.
 void setUnits(TimePeriod.Units value)
          Time units.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

TimePeriod

public TimePeriod()
No argument constructor.

TimePeriod

public TimePeriod(int amount,
                  TimePeriod.Units units)
Constructor.

Method Detail

getAmount

public int getAmount()
The time period amount. e.g. two minutes, two hours.
Returns:
the value of the property.

setAmount

public void setAmount(int value)
The time period amount. e.g. two minutes, two hours.
Parameters:
value - the new value for the property.

getUnits

public TimePeriod.Units getUnits()
Time units. e.g. two minutes, two hours.
Returns:
the value of the property.

setUnits

public void setUnits(TimePeriod.Units value)
Time units. e.g. two minutes, two hours.
Parameters:
value - the new value for the property.

Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


Copyright © 2011, Oracle. All rights reserved.