SetBase
open class SetBase : DataValue
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
size
of 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
capacity
Initial capacity.
-
The data type for this list.
Declaration
Swift
override open var dataType: DataType { get }
-
true
if this set is empty.Declaration
Swift
@inline(__always) public final var isEmpty: Bool { get }
-
true
if this set is mutable.Declaration
Swift
@inline(__always) public final var isMutable: Bool { get }
-
true
if 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
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.
-
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 }