Another set. もう一方の集合。
Instance Method
インスタンスメソッド
is
isDisjoint(with:)
Returns a Boolean value that indicates whether this set has no members in common with the given set.
この集合は与えられた集合と共通のメンバを1つも持たないかどうかを指し示すブール値を返します。
Availability
- iOS 8.0+
- iPadOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 8.0+
Technology
- Swift Standard Library Swift標準ライブラリ
Declaration 宣言
Parameters パラメータ
other
Return Value 戻り値
true
if the set has no elements in common with other
; otherwise, false
.
この集合がother
と共通の要素を持たないならばtrue
;そうでなければ、false
。
Discussion 解説
In the following example, the employees
set is disjoint with the visitors
set because no name appears in both sets.
次の例において、employees
集合はvisitors
集合と交わりを持ちません、両方に現れる名前がないからです。
let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"]
let visitors: Set = ["Marcia", "Nathaniel", "Olivia"]
print(employees.isDisjoint(with: visitors))
// Prints "true"
Relationships 関係
From Protocol 由来プロトコル
See Also 参照
Comparing Sets 集合を比較する
static func == (Set<Element>, Set<Element>) -> Bool
Returns a Boolean value indicating whether two sets have equal elements.
2つの集合がまったく等しい要素らを持つかどうかを指し示すブール値を返します。
static func != (Set<Element>, Set<Element>) -> Bool
Returns a Boolean value indicating whether two values are not equal.
2つの値が等しくないかどうかを指し示すブール値を返します。
func isSubset (of: Set<Element>) -> Bool
Returns a Boolean value that indicates whether this set is a subset of the given set.
この集合は与えられた集合の下位集合であるかどうかを指し示すブール値を返します。
func isSubset <S>(of: S) -> Bool
Returns a Boolean value that indicates whether the set is a subset of the given sequence.
この集合は与えられたシーケンスの下位集合であるかどうかを指し示すブール値を返します。
func isStrictSubset (of: Set<Element>) -> Bool
Returns a Boolean value that indicates whether the set is a strict subset of the given sequence.
この集合は与えられたシーケンスの狭義の下位集合であるかどうかを指し示すブール値を返します。
func isStrictSubset <S>(of: S) -> Bool
Returns a Boolean value that indicates whether the set is a strict subset of the given sequence.
この集合は与えられたシーケンスの狭義の下位集合であるかどうかを指し示すブール値を返します。
func isSuperset (of: Set<Element>) -> Bool
Returns a Boolean value that indicates whether this set is a superset of the given set.
この集合は与えられた集合の上位集合であるかどうかを指し示すブール値を返します。
func isSuperset <S>(of: S) -> Bool
Returns a Boolean value that indicates whether the set is a superset of the given sequence.
この集合は与えられたシーケンスの上位集合であるかどうかを指し示すブール値を返します。
func isStrictSuperset (of: Set<Element>) -> Bool
Returns a Boolean value that indicates whether the set is a strict superset of the given sequence.
この集合は与えられたシーケンスの狭義の上位集合であるかどうかを指し示すブール値を返します。
func isStrictSuperset <S>(of: S) -> Bool
Returns a Boolean value that indicates whether the set is a strict superset of the given sequence.
この集合は与えられたシーケンスの狭義の上位集合であるかどうかを指し示すブール値を返します。
func isDisjoint <S>(with: S) -> Bool
Returns a Boolean value that indicates whether the set has no members in common with the given sequence.
この集合は与えられたシーケンスと共通のメンバを1つも持たないかどうかを指し示すブール値を返します。