public class IlrDuration
extends java.lang.Object
implements java.io.Serializable
http://www.w3.org/TR/xmlschema-2/#duration).| Constructor and Description |
|---|
IlrDuration()
Build a null duration.
|
IlrDuration(boolean positive,
short year,
short month,
short day,
short hour,
short minute,
short second)
Build a duration defined by year/month/day/hour/minute/second.
|
IlrDuration(java.lang.String str)
Build a duration from a string.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(IlrDuration date)
Compare two durations.
|
boolean |
equals(java.lang.Object obj) |
short |
getDay()
Get the day.
|
java.lang.String |
getFractionalSecond()
Get the remaining fractional second.
|
short |
getHour()
Get the hour.
|
short |
getMinute()
Get the minute.
|
short |
getMonth()
Get the month.
|
short |
getSeconds()
Get the second.
|
short |
getYear()
Get the year.
|
boolean |
isEqual(IlrDuration d)
Determine if two duration objects are equal.
|
boolean |
isNegative()
Determine if the duration is negative.
|
boolean |
isPositive()
Determine if the duration is positive.
|
static IlrDuration |
parse(java.lang.String str)
Create a duration from a string.
|
void |
setDay(short day)
Set the day.
|
void |
setHour(short hour)
Set the hour.
|
void |
setMinute(short minute)
Set the minute.
|
void |
setMonth(short month)
Set the month.
|
void |
setSecond(short second)
set the second.
|
void |
setSign(boolean positive)
Set the sign of the duration.
|
void |
setValue(boolean isPositive,
short year,
short month,
short day,
short hour,
short minute,
short second)
Set the duration.
|
void |
setYear(short year)
Set the year.
|
java.lang.String |
toString() |
static IlrDuration |
valueOf(java.lang.String str)
Create a duration from a string.
|
public IlrDuration()
public IlrDuration(boolean positive,
short year,
short month,
short day,
short hour,
short minute,
short second)
public IlrDuration(java.lang.String str)
throws IlrDateFormatException
IlrDateFormatException - when the string has an invalid format.public void setYear(short year)
public void setMonth(short month)
public void setDay(short day)
public void setHour(short hour)
public void setMinute(short minute)
public void setSecond(short second)
public void setSign(boolean positive)
public void setValue(boolean isPositive,
short year,
short month,
short day,
short hour,
short minute,
short second)
public short getYear()
public short getMonth()
public short getDay()
public short getHour()
public short getMinute()
public short getSeconds()
public java.lang.String getFractionalSecond()
public boolean isPositive()
public boolean isNegative()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isEqual(IlrDuration d)
IlrDate to Date and comparing them.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(IlrDuration date)
public static IlrDuration parse(java.lang.String str) throws IlrDateFormatException
IlrDateFormatException - when the string format is invalid.public static IlrDuration valueOf(java.lang.String str)
IlrDateFormatException - when the string format is invalid.© Copyright IBM Corp. 1987, 2017