Record Class BipartiteUtil.BipartiteResult<V>
java.lang.Object
java.lang.Record
cloud.opencode.base.graph.algorithm.BipartiteUtil.BipartiteResult<V>
- Type Parameters:
V- the vertex type | 顶点类型- Record Components:
bipartite- whether the graph is bipartite | 图是否为二部图left- the left partition (empty if not bipartite) | 左分区(非二部图时为空)right- the right partition (empty if not bipartite) | 右分区(非二部图时为空)oddCycle- the odd cycle witness (empty if bipartite) | 奇数环证据(二部图时为空)
- Enclosing class:
BipartiteUtil
public static record BipartiteUtil.BipartiteResult<V>(boolean bipartite, Set<V> left, Set<V> right, List<V> oddCycle)
extends Record
Result of bipartite check containing partition sets or odd cycle witness.
二部图检查结果,包含分区集合或奇数环证据。
- Since:
- JDK 25, opencode-base-graph V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thebipartiterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.left()Returns the value of theleftrecord component.oddCycle()Returns the value of theoddCyclerecord component.static <V> BipartiteUtil.BipartiteResult<V> ofBipartite(Set<V> left, Set<V> right) Create a bipartite result with left and right partitions.static <V> BipartiteUtil.BipartiteResult<V> ofNotBipartite(List<V> oddCycle) Create a not-bipartite result with an odd cycle witness.right()Returns the value of therightrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
ofBipartite
Create a bipartite result with left and right partitions. 创建包含左右分区的二部图结果。- Type Parameters:
V- the vertex type | 顶点类型- Parameters:
left- the left partition | 左分区right- the right partition | 右分区- Returns:
- bipartite result | 二部图结果
-
ofNotBipartite
Create a not-bipartite result with an odd cycle witness. 创建包含奇数环证据的非二部图结果。- Type Parameters:
V- the vertex type | 顶点类型- Parameters:
oddCycle- the odd cycle witness | 奇数环证据- Returns:
- not-bipartite result | 非二部图结果
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
bipartite
-
left
-
right
-
oddCycle
-