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 if left == right, or 1 if left > right.

  • Compare this yearMonthDuration with another yearMonthDuration.

    Declaration

    Swift

    open func compareTo(_ value: YearMonthDuration) -> Int

    Parameters

    value

    The other yearMonthDuration value.

    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.

  • Declaration

    Swift

    override open func copyMutable() -> DataValue

    Return Value

    A clone of this value if it (together with all value subcomponents) is possibly mutable, or return self value if it (together with all value subcomponents) is definitely immutable. The resulting value might share mutable metadata with this query.

  • 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 if left is equal to right, otherwise false.

  • Compare this yearMonthDuration value with another yearMonthDuration value.

    Declaration

    Swift

    override open func equals(_ other: AnyObject?) -> Bool

    Parameters

    other

    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. Oherwise false.

  • 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 if left is greater than or equal to right, otherwise false.

  • 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. Oherwise false.

  • 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 if left is greater than right, otherwise false.

  • 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. Oherwise false.

  • 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 if left is less than or equal to right, otherwise false.

  • 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. Oherwise false.

  • 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 if left is less than right, otherwise false.

  • Declaration

    Swift

    open class func literal(_ text: String) -> YearMonthDuration

    Parameters

    text

    Value in XML Schema format.

    Return Value

    Value parsed from XML Schema format, or panic if text has invalid duration format. Use parse if the text is not guaranteed to be in the correct format.

  • 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. Oherwise false.

  • 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 if left is not equal to right, otherwise false.

  • 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 if text 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 }