YearMonthDuration
open class YearMonthDuration : DataValue
Represents the XML Schema yearMonthDuration type.
-
Compare two yearMonthDuration values.
Declaration
Swift
open class func compare(_ left: YearMonthDuration, _ right: YearMonthDuration) -> Int
Parameters
left
The first yearMonthDuration for comparison.
right
The second yearMonthDuration for comparison.
Return Value
-1 if
left < right
, 0 ifleft == right
, or 1 ifleft > right
. -
Compare this yearMonthDuration with another yearMonthDuration.
Declaration
Swift
open func compareTo(_ value: YearMonthDuration) -> Int
Parameters
value
The other yearMonthDuration.
Return Value
-1 if this yearMonthDuration is less than the value yearMonthDuration, 0 if they are equal, 1 if this yearMonthDuration is greater than the value yearMonthDuration.
-
Data type of the wrapped value.
Declaration
Swift
override open var dataType: DataType { get }
-
Compare two yearMonthDuration values.
Declaration
Swift
open class func equal(_ left: YearMonthDuration?, _ right: YearMonthDuration?) -> Bool
Parameters
left
The first yearMonthDuration for comparison.
right
The second yearMonthDuration for comparison.
Return Value
true
ifleft
is equal toright
, otherwisefalse
. -
Compare this yearMonthDuration value with another yearMonthDuration value.
Declaration
Swift
override open func equals(_ value: AnyObject?) -> Bool
Parameters
value
The other yearMonthDuration value.
Return Value
True, if this yearMonthDuration value is equal to the value yearMonthDuration value. Otherwise
false
. -
Compare this yearMonthDuration value with another yearMonthDuration value.
Declaration
Swift
open func greaterEqual(_ value: YearMonthDuration) -> Bool
Parameters
value
The other yearMonthDuration value.
Return Value
true
if this yearMonthDuration value is greater than or equal to the value yearMonthDuration value. Oherwisefalse
. -
Compare two yearMonthDuration values.
Declaration
Swift
open class func greaterEqual(_ left: YearMonthDuration, _ right: YearMonthDuration) -> Bool
Parameters
left
The first yearMonthDuration for comparison.
right
The second yearMonthDuration for comparison.
Return Value
true
ifleft
is greater than or equal toright
, otherwisefalse
. -
Compare this yearMonthDuration value with another yearMonthDuration value.
Declaration
Swift
open func greaterThan(_ value: YearMonthDuration) -> Bool
Parameters
value
The other yearMonthDuration value.
Return Value
true
if this yearMonthDuration value is greater than the value yearMonthDuration value. Oherwisefalse
. -
Compare two yearMonthDuration values.
Declaration
Swift
open class func greaterThan(_ left: YearMonthDuration, _ right: YearMonthDuration) -> Bool
Parameters
left
The first yearMonthDuration for comparison.
right
The second yearMonthDuration for comparison.
Return Value
true
ifleft
is greater thanright
, otherwisefalse
. -
Hash this data value to a number.
Declaration
Swift
override open func hashCode() -> Int
Return Value
Any value in the range of type
int
. -
Compare this yearMonthDuration value with another yearMonthDuration value.
Declaration
Swift
open func lessEqual(_ value: YearMonthDuration) -> Bool
Parameters
value
The other yearMonthDuration value.
Return Value
true
if this yearMonthDuration value is less than or equal to the value yearMonthDuration value. Oherwisefalse
. -
Compare two yearMonthDuration values.
Declaration
Swift
open class func lessEqual(_ left: YearMonthDuration, _ right: YearMonthDuration) -> Bool
Parameters
left
The first yearMonthDuration for comparison.
right
The second yearMonthDuration for comparison.
Return Value
true
ifleft
is less than or equal toright
, otherwisefalse
. -
Compare this yearMonthDuration value with another yearMonthDuration value.
Declaration
Swift
open func lessThan(_ value: YearMonthDuration) -> Bool
Parameters
value
The other yearMonthDuration value.
Return Value
true
if this yearMonthDuration value is less than the value yearMonthDuration value. Oherwisefalse
. -
Compare two yearMonthDuration values.
Declaration
Swift
open class func lessThan(_ left: YearMonthDuration, _ right: YearMonthDuration) -> Bool
Parameters
left
The first yearMonthDuration for comparison.
right
The second yearMonthDuration for comparison.
Return Value
true
ifleft
is less thanright
, otherwisefalse
. -
Months field of duration (non-negative).
Declaration
Swift
open var months: Int { get }
-
Declaration
Swift
open func normalize() -> YearMonthDuration
Return Value
An equivalent value with all fields normalized. The result value will have months < 12. The result value will be
equal
to this value. -
Compare this yearMonthDuration value with another yearMonthDuration value.
Declaration
Swift
open func notEqual(_ value: YearMonthDuration) -> Bool
Parameters
value
The other yearMonthDuration value.
Return Value
true
if this yearMonthDuration value is not equal to the value yearMonthDuration value. Oherwisefalse
. -
Compare two yearMonthDuration values.
Declaration
Swift
open class func notEqual(_ left: YearMonthDuration?, _ right: YearMonthDuration?) -> Bool
Parameters
left
The first yearMonthDuration for comparison.
right
The second yearMonthDuration for comparison.
Return Value
true
ifleft
is not equal toright
, otherwisefalse
. -
Declaration
Swift
open class func of(sign: Int, years: Int, months: Int) -> YearMonthDuration
Parameters
sign
The sign field (+1, 0 or -1).
years
The years field (non-negative).
months
The months field (non-negative).
Return Value
A new year/month duration.
-
Declaration
Swift
open class func parse(_ text: String) -> YearMonthDuration?
Parameters
text
Value in XML Schema format.
Return Value
Value parsed from XML Schema format, or
nil
iftext
has invalid duration format. -
Sign of the duration (+1, 0 or -1).
Declaration
Swift
open var sign: Int { get }
-
Convert this data value to a string. If the
dataType
is defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used. JSON format is used for structured values (arrays and objects).Declaration
Swift
override open func toString() -> String
Return Value
Lexical representation of this data value.
-
Years field of duration (non-negative).
Declaration
Swift
open var years: Int { get }