Object
Cloneable
, Comparable
, Serializable
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.Object
TimePeriod
Cloneable
, Comparable
, Serializable
Constructor Summary |
|
Method Summary |
public |
|
public int |
|
public int | |
public static |
|
public static |
|
public static |
|
public |
|
public |
|
public |
|
public void |
|
public void |
|
public |
|
Methods from class java.lang. |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods from interface java.lang. |
compareTo |
Constructor Detail |
protected TimePeriod()
Method Detail |
public Object
clone()
Returns a copy of this TimeDuration.
Object.clone()
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.
public int compareTo(Object
anotherObject)
Compares this TimePeriod with another object. If the other
object is a TimePeriod, this method behaves like
compareTo(TimePeriod). Otherwise, it throws a
ClassCastException.
public static TimePeriod
createTimePeriod()
Returns a TimePeriod instance for the current
time at the local time zone with zero duration.
public staticGiven the start time instant and duration, returns a TimePeriod instance.TimePeriod
createTimePeriod(String
start,String
duration)
throwsParseException
ParseException
public staticGiven the start time instant and duration, returns a TimePeriod instance.TimePeriod
createTimePeriod(TimeInstant
start,TimeDuration
duration)
public TimeDuration
getDuration()
Returns the duration for this TimePeriod.
public TimeInstant
getEnd()
Returns the end of this duration based on the current values of
start time instannt and duration.
public TimeInstant
getStart()
Returns the instant at which this TimePeriod
starts.
public void setDuration(TimeDuration
duration)
Sets the duration for this TimePeriod.
public void setStart(TimeInstant
start)
Sets the instant at which this TimePeriod starts.
public String
toString()
Returns a XML schema compliant timePeriod string.
Object.toString()