Class OldFileSourceDGS

All Implemented Interfaces:
FileSource, Source

public class OldFileSourceDGS
extends FileSourceBase
Class responsible for parsing files in the DGS format.

The DGS file format is especially designed for storing dynamic graph definitions into a file. More information about the DGS file format will be found on the GraphStream web site: http://graphstream-project.org/

The usual file name extension used for this format is ".dgs".
See Also:
FileSource
  • Constructor Details

    • OldFileSourceDGS

      public OldFileSourceDGS()
      New reader for the DGS graph file format version 3.
  • Method Details

    • nextEvents

      public boolean nextEvents() throws IOException
      Description copied from interface: FileSource
      Try to process one graph event, or as few as possible, if more must be read at once. For this method to work, you must have called FileSource.begin(InputStream) or FileSource.begin(String) before. This method return true while there are still events to read.
      Specified by:
      nextEvents in interface FileSource
      Specified by:
      nextEvents in class FileSourceBase
      Returns:
      true if there are still events to read, false as soon as the file is finished.
      Throws:
      IOException - If an I/O error occurs while reading.
    • nextStep

      public boolean nextStep() throws IOException
      Description copied from interface: FileSource
      Try to process all the events occurring during one time step. In GraphStream, a time step is a group of events that are considered occurring at the same time. Most file formats do not have this notion of step. The DGS format designed for GraphStream handles steps. This method return true while there are still events to read.
      Returns:
      true if there are still events to read, false as soon as the file is finished.
      Throws:
      IOException - If an I/O error occurs while reading.
    • begin

      public void begin​(String filename) throws IOException
      Description copied from interface: FileSource
      Begin reading the file stopping as soon as possible. Next graph events stored in the file will be sent by calling FileSource.nextEvents() or FileSource.nextStep(). Once begin() has been called, you must finish the reading process using FileSource.end(). You cannot call begin() twice without having called FileSource.end() in between.
      Specified by:
      begin in interface FileSource
      Overrides:
      begin in class FileSourceBase
      Parameters:
      filename - Name of the file to read.
      Throws:
      IOException - If an I/O error occurs while reading.
    • begin

      public void begin​(URL url) throws IOException
      Description copied from interface: FileSource
      Begin reading the file stopping as soon as possible. Next graph events stored in the file will be sent by calling FileSource.nextEvents() or FileSource.nextStep(). Once begin() has been called, you must finish the reading process using FileSource.end(). You cannot call begin() twice without having called FileSource.end() in between.
      Specified by:
      begin in interface FileSource
      Overrides:
      begin in class FileSourceBase
      Parameters:
      url - The URL of the file to read.
      Throws:
      IOException - If an I/O error occurs while reading.
    • begin

      public void begin​(InputStream stream) throws IOException
      Description copied from interface: FileSource
      Begin reading the file stopping as soon as possible. Next graph events stored in the file will be sent by calling FileSource.nextEvents() or FileSource.nextStep(). Once begin() has been called, you must finish the reading process using FileSource.end(). You cannot call begin() twice without having called FileSource.end() in between.
      Specified by:
      begin in interface FileSource
      Overrides:
      begin in class FileSourceBase
      Parameters:
      stream - The input stream to use for reading.
      Throws:
      IOException - If an I/O error occurs while reading.
    • begin

      public void begin​(Reader reader) throws IOException
      Description copied from interface: FileSource
      Begin reading the file stopping as soon as possible. Next graph events stored in the file will be sent by calling FileSource.nextEvents() or FileSource.nextStep(). Once begin() has been called, you must finish the reading process using FileSource.end(). You cannot call begin() twice without having called FileSource.end() in between.
      Specified by:
      begin in interface FileSource
      Overrides:
      begin in class FileSourceBase
      Parameters:
      reader - The file reader to use.
      Throws:
      IOException - If an I/O error occurs while reading.