This class implements some of the functionality of the Java javax.xml.datatype.Duration class. Only the functionality needed by the XBinder C# runtime is implemented. Normalization of all fields is done with the exception of days to months or days to years. For example, an instance specifying 1 minute and 65 seconds will be normalized to 2 minutes and 5 seconds. But an instance specifying 1 month and any number of days higher than 27 will not be normalized, since the result of the normalization would depend on the starting point in time of the duration, which we don't know.
More...
|
| XBDuration (bool isPositive, uint years, uint months, uint days, uint hours, uint minutes, double seconds) |
| Constructs an instance of XBDuration with the specified values. More...
|
|
| XBDuration (string textDuration) |
| Constructs an instance of XBDuration using a text duration specification. This constructor does only limited sanity checking of the duration specification; that's not its purpose. Consequently, the behavior is undefined if an invalid duration specification is passed. More...
|
|
override bool | Equals (object obj) |
| Override of the Object.Equals method. This override implements value equality checking, not reference equality checking. More...
|
|
override int | GetHashCode () |
| Override of the Object.GetHashCode method. More...
|
|
override string | ToString () |
| Returns a string representation of the duration. If the duration was constructed using a text duration specification, then all items specified in the input text duration will also be specified in this output text duration, even if they have 0 as the value. More...
|
|
|
uint | Years [get, set] |
| The number of years defined in the duration. More...
|
|
uint | Months [get, set] |
| The number of months defined in the duration. More...
|
|
uint | Days [get, set] |
| The number of days defined in the duration. More...
|
|
uint | Hours [get, set] |
| The number of hours defined in the duration. More...
|
|
uint | Minutes [get, set] |
| The number of minutes defined in the duration. More...
|
|
double | Seconds [get, set] |
| The quantity of seconds defined in the duration. More...
|
|
int | Sign [get, set] |
| The sign of the duration (-1 means a negative duration, 0 means the duration is 0, 1 means a positive duration) More...
|
|
This class implements some of the functionality of the Java javax.xml.datatype.Duration class. Only the functionality needed by the XBinder C# runtime is implemented. Normalization of all fields is done with the exception of days to months or days to years. For example, an instance specifying 1 minute and 65 seconds will be normalized to 2 minutes and 5 seconds. But an instance specifying 1 month and any number of days higher than 27 will not be normalized, since the result of the normalization would depend on the starting point in time of the duration, which we don't know.
◆ XBDuration() [1/2]
com.objsys.xbinder.runtime.XBDuration.XBDuration |
( |
bool |
isPositive, |
|
|
uint |
years, |
|
|
uint |
months, |
|
|
uint |
days, |
|
|
uint |
hours, |
|
|
uint |
minutes, |
|
|
double |
seconds |
|
) |
| |
Constructs an instance of XBDuration with the specified values.
- Parameters
-
isPositive | If true, sign is positive; otherwise, sign is negative |
years | Number of years for the duration |
months | Number of months for the duration |
days | Number of days for the duration |
hours | Number of hours for the duration |
minutes | Number of minutes for the duration |
seconds | Quantity of seconds for the duration |
◆ XBDuration() [2/2]
com.objsys.xbinder.runtime.XBDuration.XBDuration |
( |
string |
textDuration | ) |
|
Constructs an instance of XBDuration using a text duration specification. This constructor does only limited sanity checking of the duration specification; that's not its purpose. Consequently, the behavior is undefined if an invalid duration specification is passed.
If the ToString() method is subsquetly used to build a new text representation of this duration, then all items specified in this input text duration will also be specified in the output text duration, even if they have 0 as a value.
- Parameters
-
textDuration | Duration specification that follows the XML Schema duration syntax ([-]PnYnMnDTnHnMnS). |
◆ Equals()
override bool com.objsys.xbinder.runtime.XBDuration.Equals |
( |
object |
obj | ) |
|
Override of the Object.Equals method. This override implements value equality checking, not reference equality checking.
- Parameters
-
obj | The object to compare with the current object. |
- Returns
- True if the specified object is equal to the current object, false otherwise.
◆ GetHashCode()
override int com.objsys.xbinder.runtime.XBDuration.GetHashCode |
( |
| ) |
|
Override of the Object.GetHashCode method.
- Returns
- Hash code
◆ ToString()
override string com.objsys.xbinder.runtime.XBDuration.ToString |
( |
| ) |
|
Returns a string representation of the duration. If the duration was constructed using a text duration specification, then all items specified in the input text duration will also be specified in this output text duration, even if they have 0 as the value.
- Returns
◆ Days
uint com.objsys.xbinder.runtime.XBDuration.Days |
|
getset |
The number of days defined in the duration.
◆ Hours
uint com.objsys.xbinder.runtime.XBDuration.Hours |
|
getset |
The number of hours defined in the duration.
◆ Minutes
uint com.objsys.xbinder.runtime.XBDuration.Minutes |
|
getset |
The number of minutes defined in the duration.
◆ Months
uint com.objsys.xbinder.runtime.XBDuration.Months |
|
getset |
The number of months defined in the duration.
◆ Seconds
double com.objsys.xbinder.runtime.XBDuration.Seconds |
|
getset |
The quantity of seconds defined in the duration.
◆ Sign
int com.objsys.xbinder.runtime.XBDuration.Sign |
|
getset |
The sign of the duration (-1 means a negative duration, 0 means the duration is 0, 1 means a positive duration)
◆ Years
uint com.objsys.xbinder.runtime.XBDuration.Years |
|
getset |
The number of years defined in the duration.