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 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 a DiffResult record class.
      Parameters:
      addedVertices - the value for the addedVertices record component
      removedVertices - the value for the removedVertices record component
      commonVertices - the value for the commonVertices record component
      addedEdges - the value for the addedEdges record component
      removedEdges - the value for the removedEdges record component
      commonEdges - the value for the commonEdges record 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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • addedVertices

      public Set<V> addedVertices()
      Returns the value of the addedVertices record component.
      Returns:
      the value of the addedVertices record component
    • removedVertices

      public Set<V> removedVertices()
      Returns the value of the removedVertices record component.
      Returns:
      the value of the removedVertices record component
    • commonVertices

      public Set<V> commonVertices()
      Returns the value of the commonVertices record component.
      Returns:
      the value of the commonVertices record component
    • addedEdges

      public Set<Edge<V>> addedEdges()
      Returns the value of the addedEdges record component.
      Returns:
      the value of the addedEdges record component
    • removedEdges

      public Set<Edge<V>> removedEdges()
      Returns the value of the removedEdges record component.
      Returns:
      the value of the removedEdges record component
    • commonEdges

      public Set<Edge<V>> commonEdges()
      Returns the value of the commonEdges record component.
      Returns:
      the value of the commonEdges record component