Class TextCommunitiesReader<U>

java.lang.Object
es.uam.eps.ir.relison.sna.community.io.TextCommunitiesReader<U>
Type Parameters:
U - type of the users
All Implemented Interfaces:
CommunitiesReader<U>

public class TextCommunitiesReader<U>
extends java.lang.Object
implements CommunitiesReader<U>
Reads a file containing the community structure.

File structure:

node community

  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.lang.String delimiter
    Delimiter separating node identifier and community.
    private org.ranksys.formats.parsing.Parser<U> parser
    Parser for the users.
  • Constructor Summary

    Constructors 
    Constructor Description
    TextCommunitiesReader​(java.lang.String delimiter, org.ranksys.formats.parsing.Parser<U> parser)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    Communities<U> read​(java.lang.String file)
    Reads the community structure from a file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • delimiter

      private final java.lang.String delimiter
      Delimiter separating node identifier and community.
    • parser

      private final org.ranksys.formats.parsing.Parser<U> parser
      Parser for the users.
  • Constructor Details

    • TextCommunitiesReader

      public TextCommunitiesReader​(java.lang.String delimiter, org.ranksys.formats.parsing.Parser<U> parser)
      Constructor.
      Parameters:
      delimiter - delimiter separating node identifier and community identifier.
      parser - user parser for reading the users.
  • Method Details

    • read

      public Communities<U> read​(java.lang.String file)
      Description copied from interface: CommunitiesReader
      Reads the community structure from a file.
      Specified by:
      read in interface CommunitiesReader<U>
      Parameters:
      file - the file containing the community structure.
      Returns:
      the community partition.