SetType

Conforming types should have efficient remove, insert, and contains methods. Conforming types get set-like methods - union, etc.

  • Return a new SetType with elements that are either in self or a finite sequence but do not occur in both.

    Declaration

    Swift

    public func exclusiveOr<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S) -> Self
  • For each element of a finite sequence, remove it from self if it is a common element, otherwise add it to the SetType.

    Declaration

    Swift

    public mutating func exclusiveOrInPlace<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S)
  • Return a new set with elements common to self and a finite sequence.

    Declaration

    Swift

    public func intersect<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S) -> Self
  • Remove any elements of self that aren’t also in a finite sequence.

    Declaration

    Swift

    public mutating func intersectInPlace<
        S : SequenceType where S.Generator.Element == Generator.Element
        > (sequence: S)
  • Returns true if no elements in self are in a finite sequence.

    Declaration

    Swift

    public func isDisjointWith<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S) -> Bool
  • Returns true if self is a superset of a finite sequence.

    Declaration

    Swift

    public func isSupersetOf<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S) -> Bool
  • Returns true if self is a subset of a finite sequence

    Declaration

    Swift

    public func isSubsetOf<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S) -> Bool
  • Return a new SetType with elements in self that do not occur in a finite sequence.

    Declaration

    Swift

    public func subtract<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S) -> Self
  • Remove all elements in self that occur in a finite sequence.

    Declaration

    Swift

    public mutating func subtractInPlace<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S)
  • Return a new SetType with items in both self and a finite sequence.

    Declaration

    Swift

    public func union<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S) -> Self
  • Insert the elements of a finite sequence into self

    Declaration

    Swift

    public mutating func unionInPlace<
        S : SequenceType where S.Generator.Element == Generator.Element
        >(sequence: S)