Package moss

Class NEListReader

All Implemented Interfaces:
Closeable, Serializable, AutoCloseable, Readable

public class NEListReader extends GraphReader
Class for readers for a simple node/edge list format.
Since:
2007.06.22
See Also:
  • Constructor Details

    • NEListReader

      public NEListReader(Reader reader, int mode, NEList ntn)
      Create a reader for a simple node/edge list format.
      Parameters:
      reader - the reader to read from
      mode - the read mode
      ntn - the notation to use
      Since:
      2021.10.17 (Christian Borgelt)
    • NEListReader

      public NEListReader(Reader reader, int mode)
      Create a reader for a simple node/edge list format.
      Parameters:
      reader - the reader to read from
      mode - the read mode
      Since:
      2007.06.22 (Christian Borgelt)
  • Method Details

    • readHeader

      public boolean readHeader() throws IOException
      Read an (optional) header.
      Specified by:
      readHeader in class GraphReader
      Returns:
      false, because headers are not supported
      Throws:
      IOException - if an i/o error occurs
      Since:
      2007.06.22 (Christian Borgelt)
    • readNextField

      public String readNextField() throws IOException
      Read a field.
      Returns:
      the field read
      Throws:
      IOException - if no field could be read
      Since:
      2007.06.29 (Christian Borgelt)
    • readGraph

      public boolean readGraph() throws IOException
      Read a graph.

      The next graph description is read and split into the graph name, the associated value, the actual graph description, and (only in mode SUBS) the support information.

      These properties may then be retrieved with the functions getName(), getValue(), getGraph() etc.
      Specified by:
      readGraph in class GraphReader
      Returns:
      whether a graph description could be read (otherwise the end of the input has been reached)
      Throws:
      IOException - if an i/o error or a parse error occurs
      Since:
      2007.02.24 (Christian Borgelt)
    • getDesc

      public String getDesc()
      Get a (line) description of the current graph.

      Since a connection table is not a line description, it is reformatted into the LiNoG format.

      Overrides:
      getDesc in class GraphReader
      Returns:
      a line description (LiNoG) of the current graph
      Since:
      2007.07.06 (Christian Borgelt)
    • main

      public static void main(String[] args)
      Main function for testing basic functionality.
      Parameters:
      args - the command line arguments
      Since:
      2007.06.29 (Christian Borgelt)