Record Class GraphDiff.DiffResult<V>
java.lang.Object
java.lang.Record
cloud.opencode.base.graph.GraphDiff.DiffResult<V>
- Type Parameters:
V- the vertex type | 顶点类型- Record Components:
addedVertices- vertices present in after but not in before | 在after中存在但在before中不存在的顶点removedVertices- vertices present in before but not in after | 在before中存在但在after中不存在的顶点commonVertices- vertices present in both graphs | 两个图中都存在的顶点addedEdges- edges present in after but not in before | 在after中存在但在before中不存在的边removedEdges- edges present in before but not in after | 在before中存在但在after中不存在的边commonEdges- edges present in both graphs | 两个图中都存在的边
- Enclosing class:
GraphDiff
public static record GraphDiff.DiffResult<V>(Set<V> addedVertices, Set<V> removedVertices, Set<V> commonVertices, Set<Edge<V>> addedEdges, Set<Edge<V>> removedEdges, Set<Edge<V>> commonEdges)
extends Record
Result of comparing two graphs
比较两个图的结果
- Since:
- JDK 25, opencode-base-graph V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaddedEdgesrecord component.Returns the value of theaddedVerticesrecord component.Returns the value of thecommonEdgesrecord component.Returns the value of thecommonVerticesrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanCheck if there are any differences between the two graphs 检查两个图之间是否有任何差异final inthashCode()Returns a hash code value for this object.booleanisEmpty()Check if there are no differences between the two graphs 检查两个图之间是否没有差异Returns the value of theremovedEdgesrecord component.Returns the value of theremovedVerticesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DiffResult
public DiffResult(Set<V> addedVertices, Set<V> removedVertices, Set<V> commonVertices, Set<Edge<V>> addedEdges, Set<Edge<V>> removedEdges, Set<Edge<V>> commonEdges) Creates an instance of aDiffResultrecord class.- Parameters:
addedVertices- the value for theaddedVerticesrecord componentremovedVertices- the value for theremovedVerticesrecord componentcommonVertices- the value for thecommonVerticesrecord componentaddedEdges- the value for theaddedEdgesrecord componentremovedEdges- the value for theremovedEdgesrecord componentcommonEdges- the value for thecommonEdgesrecord component
-
-
Method Details
-
isEmpty
public boolean isEmpty()Check if there are no differences between the two graphs 检查两个图之间是否没有差异- Returns:
- true if no differences | 如果没有差异返回true
-
hasChanges
public boolean hasChanges()Check if there are any differences between the two graphs 检查两个图之间是否有任何差异- Returns:
- true if there are differences | 如果有差异返回true
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
addedVertices
Returns the value of theaddedVerticesrecord component.- Returns:
- the value of the
addedVerticesrecord component
-
removedVertices
Returns the value of theremovedVerticesrecord component.- Returns:
- the value of the
removedVerticesrecord component
-
commonVertices
Returns the value of thecommonVerticesrecord component.- Returns:
- the value of the
commonVerticesrecord component
-
addedEdges
Returns the value of theaddedEdgesrecord component.- Returns:
- the value of the
addedEdgesrecord component
-
removedEdges
Returns the value of theremovedEdgesrecord component.- Returns:
- the value of the
removedEdgesrecord component
-
commonEdges
Returns the value of thecommonEdgesrecord component.- Returns:
- the value of the
commonEdgesrecord component
-