Record Class CommunityDetectionUtil.CommunityResult<V>
java.lang.Object
java.lang.Record
cloud.opencode.base.graph.algorithm.CommunityDetectionUtil.CommunityResult<V>
- Type Parameters:
V- the vertex type - 顶点类型- Record Components:
communities- the detected communities - 检测到的社区vertexToCommunity- mapping from vertex to community index - 顶点到社区索引的映射modularity- the modularity score - 模块度分数iterations- number of iterations performed - 执行的迭代次数
- Enclosing class:
CommunityDetectionUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecommunitiesrecord component.intGets the number of communities.final booleanIndicates whether some other object is "equal to" this one.getCommunityOf(V vertex) Gets the community containing a vertex.final inthashCode()Returns a hash code value for this object.intReturns the value of theiterationsrecord component.doubleReturns the value of themodularityrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevertexToCommunityrecord component.
-
Constructor Details
-
CommunityResult
public CommunityResult(List<Set<V>> communities, Map<V, Integer> vertexToCommunity, double modularity, int iterations) Creates an instance of aCommunityResultrecord class.- Parameters:
communities- the value for thecommunitiesrecord componentvertexToCommunity- the value for thevertexToCommunityrecord componentmodularity- the value for themodularityrecord componentiterations- the value for theiterationsrecord component
-
-
Method Details
-
communityCount
public int communityCount()Gets the number of communities. 获取社区数量。 -
getCommunityOf
-
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. -
communities
Returns the value of thecommunitiesrecord component.- Returns:
- the value of the
communitiesrecord component
-
vertexToCommunity
Returns the value of thevertexToCommunityrecord component.- Returns:
- the value of the
vertexToCommunityrecord component
-
modularity
public double modularity()Returns the value of themodularityrecord component.- Returns:
- the value of the
modularityrecord component
-
iterations
public int iterations()Returns the value of theiterationsrecord component.- Returns:
- the value of the
iterationsrecord component
-