Record Class GraphMetrics.GraphSummary

java.lang.Object
java.lang.Record
cloud.opencode.base.graph.algorithm.GraphMetrics.GraphSummary
Record Components:
vertexCount - number of vertices | 顶点数
edgeCount - number of edges | 边数
density - edge density | 边密度
directed - whether the graph is directed | 是否有向图
connected - whether the graph is fully connected | 是否完全连通
componentCount - number of connected components | 连通分量数
diameter - graph diameter | 图直径
radius - graph radius | 图半径
averagePathLength - average shortest path length | 平均最短路径长度
averageClusteringCoefficient - average clustering coefficient | 平均聚类系数
Enclosing class:
GraphMetrics

public static record GraphMetrics.GraphSummary(int vertexCount, int edgeCount, double density, boolean directed, boolean connected, int componentCount, int diameter, int radius, double averagePathLength, double averageClusteringCoefficient) extends Record
Graph summary record containing key metrics 包含关键度量的图摘要记录
Since:
JDK 25, opencode-base-graph V1.0.3
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • GraphSummary

      public GraphSummary(int vertexCount, int edgeCount, double density, boolean directed, boolean connected, int componentCount, int diameter, int radius, double averagePathLength, double averageClusteringCoefficient)
      Creates an instance of a GraphSummary record class.
      Parameters:
      vertexCount - the value for the vertexCount record component
      edgeCount - the value for the edgeCount record component
      density - the value for the density record component
      directed - the value for the directed record component
      connected - the value for the connected record component
      componentCount - the value for the componentCount record component
      diameter - the value for the diameter record component
      radius - the value for the radius record component
      averagePathLength - the value for the averagePathLength record component
      averageClusteringCoefficient - the value for the averageClusteringCoefficient record component
  • Method Details

    • 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 the compare method from their corresponding wrapper classes.
      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.
    • vertexCount

      public int vertexCount()
      Returns the value of the vertexCount record component.
      Returns:
      the value of the vertexCount record component
    • edgeCount

      public int edgeCount()
      Returns the value of the edgeCount record component.
      Returns:
      the value of the edgeCount record component
    • density

      public double density()
      Returns the value of the density record component.
      Returns:
      the value of the density record component
    • directed

      public boolean directed()
      Returns the value of the directed record component.
      Returns:
      the value of the directed record component
    • connected

      public boolean connected()
      Returns the value of the connected record component.
      Returns:
      the value of the connected record component
    • componentCount

      public int componentCount()
      Returns the value of the componentCount record component.
      Returns:
      the value of the componentCount record component
    • diameter

      public int diameter()
      Returns the value of the diameter record component.
      Returns:
      the value of the diameter record component
    • radius

      public int radius()
      Returns the value of the radius record component.
      Returns:
      the value of the radius record component
    • averagePathLength

      public double averagePathLength()
      Returns the value of the averagePathLength record component.
      Returns:
      the value of the averagePathLength record component
    • averageClusteringCoefficient

      public double averageClusteringCoefficient()
      Returns the value of the averageClusteringCoefficient record component.
      Returns:
      the value of the averageClusteringCoefficient record component