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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Community

      public Community()
      New community instance with unique identifier.
  • Method Details

    • id

      public Integer id()
      Return the community identifier.
      Returns:
      community identifier as an Integer
    • getId

      public String getId()
      Return the community identifier as a String.
      Returns:
      community identifier as a String
    • equals

      public boolean equals​(Community c)
      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

      public String toString()
      Stringification method for Community object.
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo​(Community o)
      Comparison method for two Community objects, based on the value of their identfiers.
      Specified by:
      compareTo in interface Comparable<Community>