public class OldFileSourceDGS extends FileSourceBase
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".FileSource
FileSourceBase.CurrentFile
SourceBase.ElementType
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
attributes
An attribute set used everywhere.
|
protected int |
eventCount
Real number of events at current time.
|
protected int |
eventCountAnnounced
Number of events given in the header.
|
protected boolean |
finished
True as soon as the end of file is reached.
|
protected java.lang.String |
graphName
Name of the graph.
|
protected int |
stepCount
Real number of step at current time.
|
protected int |
stepCountAnnounced
Number of step given in the header.
|
protected int |
version
Format version.
|
attribute_classes, COMMENT_CHAR, eol_is_significant, filename, QUOTE_CHAR, st, tok_stack
attrSinks, eltsSinks, eventProcessing, eventQueue, sourceId, sourceTime
Constructor and Description |
---|
OldFileSourceDGS()
New reader for the DGS graph file format version 3.
|
Modifier and Type | Method and Description |
---|---|
protected void |
begin() |
void |
begin(java.io.InputStream stream)
Begin reading the file stopping as soon as possible.
|
void |
begin(java.io.Reader reader)
Begin reading the file stopping as soon as possible.
|
void |
begin(java.lang.String filename)
Begin reading the file stopping as soon as possible.
|
void |
begin(java.net.URL url)
Begin reading the file stopping as soon as possible.
|
protected void |
configureTokenizer(java.io.StreamTokenizer tok)
Method to override to configure the tokenizer behaviour.
|
protected void |
continueParsingInInclude()
Must be implemented to read the content of an include.
|
protected java.io.Reader |
createReaderFrom(java.io.InputStream stream)
Create a stream that can be read by the tokenizer.
|
protected java.io.Reader |
createReaderFrom(java.lang.String file)
Create a reader for by the tokenizer.
|
protected boolean |
next(boolean readSteps,
boolean stop)
Read either one event or several.
|
boolean |
nextEvents()
Try to process one graph event, or as few as possible, if more must be
read at once.
|
boolean |
nextStep()
Try to process all the events occurring during one time step.
|
protected void |
readAE() |
protected void |
readAN() |
protected java.util.ArrayList<java.lang.Object> |
readAttributeArray(java.lang.String key)
Read a list of values.
|
protected void |
readAttributes(java.util.HashMap<java.lang.String,java.lang.Object> attributes) |
protected java.lang.Object |
readAttributeValue(java.lang.String key)
Read an attribute.
|
protected void |
readCE() |
protected void |
readCG() |
protected void |
readCN() |
protected void |
readDE() |
protected void |
readDN() |
protected void |
readST() |
addAttributeClass, eatAllEols, eatAllUntilEol, eatEof, eatEol, eatEolOrEof, eatOneOfTwoWords, eatSymbol, eatSymbolOrPushback, eatSymbols, eatWord, eatWordOrPushbak, eatWords, end, getAllExceptedEof, getBoolean, getInteger, getNumber, getNumberExp, getPoint3, getReal, getString, getStringOrNumber, getStringOrWordOrNumber, getStringOrWordOrNumberO, getStringOrWordOrNumberOrPushback, getStringOrWordOrSymbolOrNumberO, getSymbol, getSymbolOrPushback, getWord, getWordOrNumber, getWordOrNumberOrStringOrEolOrEof, getWordOrString, getWordOrStringOrEolOrEof, getWordOrSymbol, getWordOrSymbolOrEof, getWordOrSymbolOrNumberOrStringOrEolOrEof, getWordOrSymbolOrPushback, getWordOrSymbolOrString, getWordOrSymbolOrStringOrEolOrEof, gotWhat, include, isFalse, isTrue, parseError, popTokenizer, pushBack, pushTokenizer, pushTokenizer, pushTokenizer, pushTokenizer, pushTokenizer, readAll, readAll, readAll, readAll
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, manageEvents, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeAttributeAdded, sendEdgeAttributeAdded, sendEdgeAttributeChanged, sendEdgeAttributeChanged, sendEdgeAttributeRemoved, sendEdgeAttributeRemoved, sendEdgeRemoved, sendEdgeRemoved, sendGraphAttributeAdded, sendGraphAttributeAdded, sendGraphAttributeChanged, sendGraphAttributeChanged, sendGraphAttributeRemoved, sendGraphAttributeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeAttributeAdded, sendNodeAttributeAdded, sendNodeAttributeChanged, sendNodeAttributeChanged, sendNodeAttributeRemoved, sendNodeAttributeRemoved, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBegins
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
protected int version
protected java.lang.String graphName
protected int stepCountAnnounced
protected int eventCountAnnounced
protected int stepCount
protected int eventCount
protected java.util.HashMap<java.lang.String,java.lang.Object> attributes
protected boolean finished
public OldFileSourceDGS()
public boolean nextEvents() throws java.io.IOException
FileSource
FileSource.begin(InputStream)
or FileSource.begin(String)
before. This method
return true while there are still events to read.nextEvents
in interface FileSource
nextEvents
in class FileSourceBase
java.io.IOException
- If an I/O error occurs while reading.public boolean nextStep() throws java.io.IOException
FileSource
java.io.IOException
- If an I/O error occurs while reading.protected boolean next(boolean readSteps, boolean stop) throws java.io.IOException
readSteps
- If true, read several events (usually starting with a step
event, but it may be preceded by other events), until another
step is encountered.stop
- If true stop at the next step encountered (and push it back so
that is is readable at the next call to this method).java.io.IOException
protected void readCE() throws java.io.IOException
java.io.IOException
protected void readCN() throws java.io.IOException
java.io.IOException
protected void readCG() throws java.io.IOException
java.io.IOException
protected void readAE() throws java.io.IOException
java.io.IOException
protected void readAN() throws java.io.IOException
java.io.IOException
protected void readDE() throws java.io.IOException
java.io.IOException
protected void readDN() throws java.io.IOException
java.io.IOException
protected void readST() throws java.io.IOException
java.io.IOException
protected void readAttributes(java.util.HashMap<java.lang.String,java.lang.Object> attributes) throws java.io.IOException
java.io.IOException
protected java.lang.Object readAttributeValue(java.lang.String key) throws java.io.IOException
key
- The attribute name, already read.java.io.IOException
protected java.util.ArrayList<java.lang.Object> readAttributeArray(java.lang.String key) throws java.io.IOException
key
- attribute keyjava.io.IOException
public void begin(java.lang.String filename) throws java.io.IOException
FileSource
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.begin
in interface FileSource
begin
in class FileSourceBase
filename
- Name of the file to read.java.io.IOException
- If an I/O error occurs while reading.public void begin(java.net.URL url) throws java.io.IOException
FileSource
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.begin
in interface FileSource
begin
in class FileSourceBase
url
- The URL of the file to read.java.io.IOException
- If an I/O error occurs while reading.public void begin(java.io.InputStream stream) throws java.io.IOException
FileSource
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.begin
in interface FileSource
begin
in class FileSourceBase
stream
- The input stream to use for reading.java.io.IOException
- If an I/O error occurs while reading.public void begin(java.io.Reader reader) throws java.io.IOException
FileSource
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.begin
in interface FileSource
begin
in class FileSourceBase
reader
- The file reader to use.java.io.IOException
- If an I/O error occurs while reading.protected void begin() throws java.io.IOException
java.io.IOException
protected void continueParsingInInclude() throws java.io.IOException
FileSourceBase
continueParsingInInclude
in class FileSourceBase
java.io.IOException
protected java.io.Reader createReaderFrom(java.lang.String file) throws java.io.FileNotFoundException
FileSourceBase
createReaderFrom
in class FileSourceBase
file
- File name to be opened.java.io.FileNotFoundException
- If the given file does not exist or un readable.protected java.io.Reader createReaderFrom(java.io.InputStream stream)
FileSourceBase
createReaderFrom
in class FileSourceBase
stream
- Input stream to be open as a reader.protected void configureTokenizer(java.io.StreamTokenizer tok) throws java.io.IOException
FileSourceBase
configureTokenizer
in class FileSourceBase
java.io.IOException