public class FileSourceDGS1And2 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/
OldFileSourceDGS
,
FileSource
Modifier and Type | Class and Description |
---|---|
protected static class |
FileSourceDGS1And2.AttributeFormat
Pair
|
protected static class |
FileSourceDGS1And2.AttributeType
Types of attributes.
|
FileSourceBase.CurrentFile
SourceBase.ElementType
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
attributes
An attribute set.
|
protected java.util.ArrayList<FileSourceDGS1And2.AttributeFormat> |
edgesFormat
Attribute count and type expected for each edges add and modify command.
|
protected int |
eventCount
Real number of events at current time.
|
protected int |
eventCountAnnounced
Number of events given in the header.
|
protected java.lang.String |
graphName
Name of the graph.
|
protected java.util.ArrayList<FileSourceDGS1And2.AttributeFormat> |
nodesFormat
Attribute count and type expected for each node add and modify command.
|
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 |
---|
FileSourceDGS1And2()
New reader for the DGS graph file format versions 1 and 2.
|
Modifier and Type | Method and Description |
---|---|
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 void |
init() |
protected boolean |
isNull(int tok) |
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
|
protected void |
parseAttributeFormat(java.util.ArrayList<FileSourceDGS1And2.AttributeFormat> format) |
protected void |
readAttributeFormat() |
protected void |
readAttributes(java.util.ArrayList<FileSourceDGS1And2.AttributeFormat> formats) |
protected void |
readNumberAttribute(java.lang.String name) |
protected void |
readStringAttribute(java.lang.String name) |
protected void |
readVectorAttribute(java.lang.String name) |
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.ArrayList<FileSourceDGS1And2.AttributeFormat> nodesFormat
protected java.util.ArrayList<FileSourceDGS1And2.AttributeFormat> edgesFormat
protected java.util.HashMap<java.lang.String,java.lang.Object> attributes
public FileSourceDGS1And2()
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
java.io.IOException
- If an I/O error occurs while reading.protected void readAttributes(java.util.ArrayList<FileSourceDGS1And2.AttributeFormat> formats) throws java.io.IOException
java.io.IOException
protected void readNumberAttribute(java.lang.String name) throws java.io.IOException
java.io.IOException
protected void readVectorAttribute(java.lang.String name) throws java.io.IOException
java.io.IOException
protected void readStringAttribute(java.lang.String name) throws java.io.IOException
java.io.IOException
protected boolean isNull(int tok)
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.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.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.protected void init() throws java.io.IOException
java.io.IOException
protected void readAttributeFormat() throws java.io.IOException
java.io.IOException
protected void parseAttributeFormat(java.util.ArrayList<FileSourceDGS1And2.AttributeFormat> format) 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