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 HashMap<String,Object> |
attributes
An attribute set.
|
protected 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 String |
graphName
Name of the graph.
|
protected 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(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 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(ArrayList<FileSourceDGS1And2.AttributeFormat> format) |
protected void |
readAttributeFormat() |
protected void |
readAttributes(ArrayList<FileSourceDGS1And2.AttributeFormat> formats) |
protected void |
readNumberAttribute(String name) |
protected void |
readStringAttribute(String name) |
protected void |
readVectorAttribute(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 int stepCountAnnounced
protected int eventCountAnnounced
protected int stepCount
protected int eventCount
protected ArrayList<FileSourceDGS1And2.AttributeFormat> nodesFormat
protected ArrayList<FileSourceDGS1And2.AttributeFormat> edgesFormat
protected HashMap<String,Object> attributes
public FileSourceDGS1And2()
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
IOException
- If an I/O error occurs while reading.protected void readAttributes(ArrayList<FileSourceDGS1And2.AttributeFormat> formats) throws IOException
IOException
protected void readNumberAttribute(String name) throws IOException
IOException
protected void readVectorAttribute(String name) throws IOException
IOException
protected void readStringAttribute(String name) throws IOException
IOException
protected boolean isNull(int tok)
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(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.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.protected void init() throws IOException
IOException
protected void readAttributeFormat() throws IOException
IOException
protected void parseAttributeFormat(ArrayList<FileSourceDGS1And2.AttributeFormat> format) 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