|
© 2004 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.p13n.xml.schema.TimePeriod
This class provides the Java biding for the XML schema type timePeriod as specified in Section 3.3.26 of XML Schema Part 2: Datatypes.
timePeriod represents a specific period of time with a given start and end.
The value of an instance of timePeriod specifies the start of the time period, while the value of dudation should be specified in the schema.
Example: 09:00:00.000Z
.
Instance of this type can be constructed from instances of TimeInstant and TimePeriod.
NOTE:
This is special case where a facet (the duration facet) should be specified while creating an instance of TimePeriod. Without this information, an instance of TimePeriod would be meaningless.
Constructor Summary | |
protected |
TimePeriod()
Constructs a new TimePeriod instance with "P0Y" as the duration and period at the current point in time. |
Method Summary | |
Object |
clone()
Returns a copy of this TimeDuration. |
int |
compareTo(Object anotherObject)
Compares this TimePeriod with another object. |
int |
compareTo(TimePeriod anotherTimePeriod)
Compares this TimePeriod to another TimePeriod object (represented in the same time zone) in their canonical representation. |
static TimePeriod |
createTimePeriod()
Returns a TimePeriod instance for the current time at the local time zone with zero duration. |
static TimePeriod |
createTimePeriod(String start,
String duration)
Given the start time instant and duration, returns a TimePeriod instance. |
static TimePeriod |
createTimePeriod(TimeInstant start,
TimeDuration duration)
Given the start time instant and duration, returns a TimePeriod instance. |
TimeDuration |
getDuration()
Returns the duration for this TimePeriod. |
TimeInstant |
getEnd()
Returns the end of this duration based on the current values of start time instannt and duration. |
TimeInstant |
getStart()
Returns the instant at which this TimePeriod starts. |
void |
setDuration(TimeDuration duration)
Sets the duration for this TimePeriod. |
void |
setStart(TimeInstant start)
Sets the instant at which this TimePeriod starts. |
String |
toString()
Returns a XML schema compliant timePeriod string. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected TimePeriod()
Method Detail |
public Object clone()
public int compareTo(Object anotherObject)
compareTo
in interface Comparable
ClassCastException
- thrown if the argument is not an
instance of TimePeriod.public int compareTo(TimePeriod anotherTimePeriod)
Compares this TimePeriod to another TimePeriod object (represented in the same time zone) in their canonical representation. Two time periods are considered to be equal if both the start time instant and duration are equal.
Two instances of time periods can be compared only when both time periods start at the same time instant.
anotherTimePeriod
- another TimePeriod object to be compared.
IllegalArgumentException
- thrown when the argument
starts at a different time instant from the current time
period.public static TimePeriod createTimePeriod()
public static TimePeriod createTimePeriod(String start, String duration) throws ParseException
start
- start time instantduration
- duration
ParseException
- thrown due to illegal
string argumentpublic static TimePeriod createTimePeriod(TimeInstant start, TimeDuration duration)
start
- start time instantduration
- duration
public TimeDuration getDuration()
public TimeInstant getEnd()
public TimeInstant getStart()
public void setDuration(TimeDuration duration)
duration
- durationpublic void setStart(TimeInstant start)
start
- starting instantpublic String toString()
Returns a XML schema compliant timePeriod string.
|
© 2004 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |