SetBase
open class SetBase : DataValue, @unchecked Sendable
Base class for strongly-typed sets.
-
The number of items in this set.
Declaration
Swift
public final var count: Int { get } -
Construct a new set with a
sizeof zero and specified initialcapacity. A set can expand in size beyond its initial capacity, but best performance will be obtained if the initial capacity is close to (and not less than) the set’s maximum size.Declaration
Swift
public init(capacity: Int)Parameters
capacityInitial capacity.
-
The data type for this list.
Declaration
Swift
override open var dataType: DataType { get } -
trueif this set is empty.Declaration
Swift
@inline(__always) public final var isEmpty: Bool { get } -
trueif this set is mutable.Declaration
Swift
@inline(__always) public final var isMutable: Bool { get } -
trueif this set is not empty.Declaration
Swift
@inline(__always) public final var isNotEmpty: Bool { get } -
Mark this set as immutable. Subsequent attempts to mutate the set will throw an
ImmutableException.Declaration
Swift
open func makeImmutable() -
Remove all values from this set.
Declaration
Swift
open func removeAll() -
The number of values in this set.
Declaration
Swift
@inline(__always) public final var size: Int { get } -
Convert this data value to a string. If the
dataTypeis 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() -> StringReturn Value
Lexical representation of this data value.
-
The underlying untyped set. Use with care, avoiding the addition of objects with an incorrect value type.
Declaration
Swift
@inline(__always) public final var untypedSet: UntypedSet { get }