Instance Method

isStrictSubset(of:)

Returns a Boolean value that indicates whether this set is a strict subset of the given set.

Declaration

func isStrictSubset(of other: AnchoringComponent.Target.Classification) -> Bool

Parameters

other

A set of the same type as the current set.

Return Value

true if the set is a strict subset of other; otherwise, false.

Discussion

Set A is a strict subset of another set B if every member of A is also a member of B and B contains at least one element that is not a member of A.

let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"]
let attendees: Set = ["Alicia", "Bethany", "Diana"]
print(attendees.isStrictSubset(of: employees))
// Prints "true"

// A set is never a strict subset of itself:
print(attendees.isStrictSubset(of: attendees))
// Prints "false"

See Also

Option Set Conformance

var isEmpty: Bool

A Boolean value that indicates whether the set has no elements.

func contains(AnchoringComponent.Target.Classification) -> Bool

Returns a Boolean value that indicates whether a given element is a member of the option set.

func formIntersection(AnchoringComponent.Target.Classification)

Removes all elements of this option set that are not also present in the given set.

func formSymmetricDifference(AnchoringComponent.Target.Classification)

Replaces this set with a new set containing all elements contained in either this set or the given set, but not in both.

func formUnion(AnchoringComponent.Target.Classification)

Inserts the elements of another set into this option set.

func intersection(AnchoringComponent.Target.Classification) -> AnchoringComponent.Target.Classification

Returns a new option set with only the elements contained in both this set and the given set.

func isDisjoint(with: AnchoringComponent.Target.Classification) -> Bool

Returns a Boolean value that indicates whether the set has no members in common with the given set.

func isStrictSuperset(of: AnchoringComponent.Target.Classification) -> Bool

Returns a Boolean value that indicates whether this set is a strict superset of the given set.

func isSubset(of: AnchoringComponent.Target.Classification) -> Bool

Returns a Boolean value that indicates whether the set is a subset of another set.

func isSuperset(of: AnchoringComponent.Target.Classification) -> Bool

Returns a Boolean value that indicates whether the set is a superset of the given set.

func subtract(AnchoringComponent.Target.Classification)

Removes the elements of the given set from this set.

func subtracting(AnchoringComponent.Target.Classification) -> AnchoringComponent.Target.Classification

Returns a new set containing the elements of this set that do not occur in the given set.

func symmetricDifference(AnchoringComponent.Target.Classification) -> AnchoringComponent.Target.Classification

Returns a new option set with the elements contained in this set or in the given set, but not in both.

func union(AnchoringComponent.Target.Classification) -> AnchoringComponent.Target.Classification

Returns a new option set of the elements contained in this set, in the given set, or in both.