org.graphstream.stream.file
Class FileSourceDGS1And2

java.lang.Object
  extended by org.graphstream.stream.SourceBase
      extended by org.graphstream.stream.file.FileSourceBase
          extended by org.graphstream.stream.file.FileSourceDGS1And2
All Implemented Interfaces:
FileSource, Source

public class FileSourceDGS1And2
extends FileSourceBase

Class responsible for parsing files in the DGS format (old versions of the 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/

See Also:
OldFileSourceDGS, FileSource

Nested Class Summary
 
Nested classes/interfaces inherited from class org.graphstream.stream.SourceBase
SourceBase.ElementType
 
Constructor Summary
FileSourceDGS1And2()
          New reader for the DGS graph file format versions 1 and 2.
 
Method Summary
 void begin(InputStream stream)
          Begin reading the file stopping as soon as possible.
 void begin(Reader reader)
          Begin reading the file stopping as soon as possible.
 void begin(String filename)
          Begin reading the file stopping as soon as possible.
 void begin(URL url)
          Begin reading the file stopping as soon as possible.
 boolean nextEvents()
          Try to process one graph event, or as few as possible, if more must be read at once.
 boolean nextStep()
          tries to read all the events between 2 steps
 
Methods inherited from class org.graphstream.stream.file.FileSourceBase
addAttributeClass, end, readAll, readAll, readAll, readAll
 
Methods inherited from class org.graphstream.stream.SourceBase
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeRemoved, sendEdgeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBegins
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.graphstream.stream.Source
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
 

Constructor Detail

FileSourceDGS1And2

public FileSourceDGS1And2()
New reader for the DGS graph file format versions 1 and 2.

Method Detail

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
tries to read all the events between 2 steps

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(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.

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.


Copyright © 2011. All Rights Reserved.