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 HashMap<String,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 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(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.
|
protected void |
configureTokenizer(StreamTokenizer tok)
Method to override to configure the tokenizer behaviour.
|
protected void |
continueParsingInInclude()
Must be implemented to read the content of an include.
|
protected Reader |
createReaderFrom(InputStream stream)
Create a stream that can be read by the tokenizer.
|
protected Reader |
createReaderFrom(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 ArrayList<Object> |
readAttributeArray(String key)
Read a list of values.
|
protected void |
readAttributes(HashMap<String,Object> attributes) |
protected Object |
readAttributeValue(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 int stepCountAnnounced
protected int eventCountAnnounced
protected int stepCount
protected int eventCount
protected HashMap<String,Object> attributes
protected boolean finished
public OldFileSourceDGS()
public boolean nextEvents() throws 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
IOException
- If an I/O error occurs while reading.public boolean nextStep() throws IOException
FileSource
IOException
- If an I/O error occurs while reading.protected boolean next(boolean readSteps, boolean stop) throws 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).IOException
protected void readCE() throws IOException
IOException
protected void readCN() throws IOException
IOException
protected void readCG() throws IOException
IOException
protected void readAE() throws IOException
IOException
protected void readAN() throws IOException
IOException
protected void readDE() throws IOException
IOException
protected void readDN() throws IOException
IOException
protected void readST() throws IOException
IOException
protected void readAttributes(HashMap<String,Object> attributes) throws IOException
IOException
protected Object readAttributeValue(String key) throws IOException
key
- The attribute name, already read.IOException
protected ArrayList<Object> readAttributeArray(String key) throws IOException
key
- attribute keyIOException
public void begin(String filename) throws 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.IOException
- If an I/O error occurs while reading.public void begin(URL url) throws 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.IOException
- If an I/O error occurs while reading.public void begin(InputStream stream) throws 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.IOException
- If an I/O error occurs while reading.public void begin(Reader reader) throws 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.IOException
- If an I/O error occurs while reading.protected void begin() throws IOException
IOException
protected void continueParsingInInclude() throws IOException
FileSourceBase
continueParsingInInclude
in class FileSourceBase
IOException
protected Reader createReaderFrom(String file) throws FileNotFoundException
FileSourceBase
createReaderFrom
in class FileSourceBase
file
- File name to be opened.FileNotFoundException
- If the given file does not exist or un readable.protected Reader createReaderFrom(InputStream stream)
FileSourceBase
createReaderFrom
in class FileSourceBase
stream
- Input stream to be open as a reader.protected void configureTokenizer(StreamTokenizer tok) throws IOException
FileSourceBase
configureTokenizer
in class FileSourceBase
IOException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses