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 Summary
ConstructorsConstructorDescriptionGraphSummary(int vertexCount, int edgeCount, double density, boolean directed, boolean connected, int componentCount, int diameter, int radius, double averagePathLength, double averageClusteringCoefficient) Creates an instance of aGraphSummaryrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theaverageClusteringCoefficientrecord component.doubleReturns the value of theaveragePathLengthrecord component.intReturns the value of thecomponentCountrecord component.booleanReturns the value of theconnectedrecord component.doubledensity()Returns the value of thedensityrecord component.intdiameter()Returns the value of thediameterrecord component.booleandirected()Returns the value of thedirectedrecord component.intReturns the value of theedgeCountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intradius()Returns the value of theradiusrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thevertexCountrecord component.
-
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 aGraphSummaryrecord class.- Parameters:
vertexCount- the value for thevertexCountrecord componentedgeCount- the value for theedgeCountrecord componentdensity- the value for thedensityrecord componentdirected- the value for thedirectedrecord componentconnected- the value for theconnectedrecord componentcomponentCount- the value for thecomponentCountrecord componentdiameter- the value for thediameterrecord componentradius- the value for theradiusrecord componentaveragePathLength- the value for theaveragePathLengthrecord componentaverageClusteringCoefficient- the value for theaverageClusteringCoefficientrecord component
-
-
Method Details
-
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 with thecomparemethod from their corresponding wrapper classes. -
vertexCount
public int vertexCount()Returns the value of thevertexCountrecord component.- Returns:
- the value of the
vertexCountrecord component
-
edgeCount
-
density
-
directed
-
connected
-
componentCount
public int componentCount()Returns the value of thecomponentCountrecord component.- Returns:
- the value of the
componentCountrecord component
-
diameter
-
radius
-
averagePathLength
public double averagePathLength()Returns the value of theaveragePathLengthrecord component.- Returns:
- the value of the
averagePathLengthrecord component
-
averageClusteringCoefficient
public double averageClusteringCoefficient()Returns the value of theaverageClusteringCoefficientrecord component.- Returns:
- the value of the
averageClusteringCoefficientrecord component
-