Class SetAlgebra.SetAlgebraImpl<E>
java.lang.Object
cloud.opencode.base.collections.SetAlgebra.SetAlgebraImpl<E>
- Type Parameters:
E- element type | 元素类型
- All Implemented Interfaces:
SetAlgebra<E>
- Enclosing interface:
SetAlgebra<E>
Default implementation of SetAlgebra.
SetAlgebra 的默认实现。
- Since:
- JDK 25, opencode-base-collections V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface SetAlgebra
SetAlgebra.SetAlgebraImpl<E> -
Method Summary
Modifier and TypeMethodDescriptiondifference(Set<?> other) Compute difference with another set (this - other).Filter elements matching a predicate.getSet()Get the underlying set.intersection(Set<?> other) Compute intersection with another set.booleanisDisjoint(Set<?> other) Check if this set is disjoint with another set.booleanisProperSubsetOf(Set<?> other) Check if this set is a proper subset of another set.booleanisProperSupersetOf(Set<?> other) Check if this set is a proper superset of another set.booleanisSubsetOf(Set<?> other) Check if this set is a subset of another set.booleanisSupersetOf(Set<?> other) Check if this set is a superset of another set.symmetricDifference(Set<? extends E> other) Compute symmetric difference with another set.Compute union with another set.
-
Method Details
-
getSet
Description copied from interface:SetAlgebraGet the underlying set. 获取底层集合。- Specified by:
getSetin interfaceSetAlgebra<E>- Returns:
- the set | 集合
-
union
Description copied from interface:SetAlgebraCompute union with another set. 计算与另一个集合的并集。- Specified by:
unionin interfaceSetAlgebra<E>- Parameters:
other- the other set | 另一个集合- Returns:
- union of the two sets | 两个集合的并集
-
intersection
Description copied from interface:SetAlgebraCompute intersection with another set. 计算与另一个集合的交集。- Specified by:
intersectionin interfaceSetAlgebra<E>- Parameters:
other- the other set | 另一个集合- Returns:
- intersection of the two sets | 两个集合的交集
-
difference
Description copied from interface:SetAlgebraCompute difference with another set (this - other). 计算与另一个集合的差集(this - other)。- Specified by:
differencein interfaceSetAlgebra<E>- Parameters:
other- the other set | 另一个集合- Returns:
- difference of the two sets | 两个集合的差集
-
symmetricDifference
Description copied from interface:SetAlgebraCompute symmetric difference with another set. 计算与另一个集合的对称差集。- Specified by:
symmetricDifferencein interfaceSetAlgebra<E>- Parameters:
other- the other set | 另一个集合- Returns:
- symmetric difference of the two sets | 两个集合的对称差集
-
isSubsetOf
Description copied from interface:SetAlgebraCheck if this set is a subset of another set. 检查此集合是否为另一个集合的子集。- Specified by:
isSubsetOfin interfaceSetAlgebra<E>- Parameters:
other- the other set | 另一个集合- Returns:
- true if this is a subset | 如果是子集则返回 true
-
isSupersetOf
Description copied from interface:SetAlgebraCheck if this set is a superset of another set. 检查此集合是否为另一个集合的超集。- Specified by:
isSupersetOfin interfaceSetAlgebra<E>- Parameters:
other- the other set | 另一个集合- Returns:
- true if this is a superset | 如果是超集则返回 true
-
isProperSubsetOf
Description copied from interface:SetAlgebraCheck if this set is a proper subset of another set. 检查此集合是否为另一个集合的真子集。- Specified by:
isProperSubsetOfin interfaceSetAlgebra<E>- Parameters:
other- the other set | 另一个集合- Returns:
- true if this is a proper subset | 如果是真子集则返回 true
-
isProperSupersetOf
Description copied from interface:SetAlgebraCheck if this set is a proper superset of another set. 检查此集合是否为另一个集合的真超集。- Specified by:
isProperSupersetOfin interfaceSetAlgebra<E>- Parameters:
other- the other set | 另一个集合- Returns:
- true if this is a proper superset | 如果是真超集则返回 true
-
isDisjoint
Description copied from interface:SetAlgebraCheck if this set is disjoint with another set. 检查此集合是否与另一个集合不相交。- Specified by:
isDisjointin interfaceSetAlgebra<E>- Parameters:
other- the other set | 另一个集合- Returns:
- true if disjoint | 如果不相交则返回 true
-
filter
Description copied from interface:SetAlgebraFilter elements matching a predicate. 过滤匹配谓词的元素。- Specified by:
filterin interfaceSetAlgebra<E>- Parameters:
predicate- the predicate | 谓词- Returns:
- filtered set | 过滤后的集合
-