UnsignedShort

open class UnsignedShort : DataValue

DataValue subclass that wraps a value of type unsignedShort.

  • Maximum unsigned short value.

    Declaration

    Swift

    public static let maxValue: Int
  • Wrapped zero value.

    Declaration

    Swift

    public static let zero: UnsignedShort
  • Compare two wrapped values for ordering.

    Declaration

    Swift

    open class func compare(_ left: UnsignedShort, _ right: UnsignedShort) -> Int

    Parameters

    left

    First object for comparison.

    right

    Second object for comparison.

    Return Value

    -1 if left.value < right.value, 0 if left.value == right.value, or 1 if left.value > right.value.

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

  • The type BasicType.UNSIGNED_SHORT.

    Declaration

    Swift

    override open var dataType: DataType { get }
  • Compare two wrapped values for equality.

    Declaration

    Swift

    open class func equal(_ left: UnsignedShort?, _ right: UnsignedShort?) -> Bool

    Parameters

    left

    First object for comparison.

    right

    Second object for comparison.

    Return Value

    true if left.value == right.value or if both arguments are nil, otherwise false.

  • Declaration

    Swift

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

    Parameters

    other

    The value to compare with.

    Return Value

    true if this object is equal to value.

  • Hash the wrapped value to a number.

    Declaration

    Swift

    override open func hashCode() -> Int

    Return Value

    Any value in the range of type int.

  • Wrap an unsignedShort value as an object.

    Declaration

    Swift

    open class func of(_ value: Int) -> UnsignedShort

    Parameters

    value

    Value to be wrapped.

    Return Value

    The wrapped value.

  • Wrap a nullable unsignedShort value as an object.

    Declaration

    Swift

    open class func of(optional value: Int?) -> UnsignedShort?

    Parameters

    value

    Value to be wrapped.

    Return Value

    The wrapped value.

  • Convert a wrapped unsignedShort value to an unsigned short.

    Throws

    CastException if value is not a wrapped unsignedShort or nil.

    Declaration

    Swift

    open class func optional(_ value: AnyObject?) -> Int?

    Parameters

    value

    The wrapped value.

    Return Value

    A nullable int.

  • Convert a signed short value to unsigned int.

    Declaration

    Swift

    open class func toInt(_ value: Int) -> Int

    Parameters

    value

    The short value.

    Return Value

    The short value, treated as unsigned, then converted to an int value.

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

  • Declaration

    Swift

    open class func truncateIfNeeded(_ value: Int) -> Int

    Parameters

    value

    The value to be truncated.

    Return Value

    The argument truncated (if needed) to the appropriate number of bits.

  • Data type code of the wrapped value, equivalent to dataType.code.

    Declaration

    Swift

    override open var typeCode: Int { get }
  • Convert a wrapped unsignedShort value to an unsigned short.

    Throws

    CastException if value is not a wrapped unsignedShort.

    Declaration

    Swift

    open class func unwrap(_ value: AnyObject?) -> Int

    Parameters

    value

    The wrapped value.

    Return Value

    An int value.

  • The wrapped value.

    Declaration

    Swift

    @inline(__always)
    public final var value: Int { get }