Class Community
java.lang.Object
org.graphstream.algorithm.community.Community
- All Implemented Interfaces:
Comparable<Community>
public class Community extends Object implements Comparable<Community>
Basic community class. Ensures that each created community object has a
unique identifier throughout the simulation. This class also allows
comparison and easy stringification of communities.
- Author:
- Guillaume-Jean Herbiet
-
Constructor Summary
Constructors Constructor Description Community()
New community instance with unique identifier. -
Method Summary
Modifier and Type Method Description int
compareTo(Community o)
Comparison method for two Community objects, based on the value of their identfiers.boolean
equals(Community c)
Tell if two Community objects are equal, based on their identifier.String
getId()
Return the community identifier as a String.Integer
id()
Return the community identifier.String
toString()
Stringification method for Community object.
-
Constructor Details
-
Community
public Community()New community instance with unique identifier.
-
-
Method Details
-
id
Return the community identifier.- Returns:
- community identifier as an Integer
-
getId
Return the community identifier as a String.- Returns:
- community identifier as a String
-
equals
Tell if two Community objects are equal, based on their identifier.- Parameters:
c
- The Community to compare to.- Returns:
- True if the two communities are equal, false otherwise.
-
toString
Stringification method for Community object. -
compareTo
Comparison method for two Community objects, based on the value of their identfiers.- Specified by:
compareTo
in interfaceComparable<Community>
-