|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.graphstream.stream.SourceBase
org.graphstream.stream.file.FileSourceParser
public abstract class FileSourceParser
This defines source using a Parser
object
to parse a stream and generate graph events.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.graphstream.stream.SourceBase |
---|
SourceBase.ElementType |
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. |
void |
end()
Finish the reading process (even if FileSource.nextEvents() or
FileSource.nextStep() did not returned false). |
abstract ParserFactory |
getNewParserFactory()
Get a new parser factory. |
boolean |
nextEvents()
Try to process one graph event, or as few as possible, if more must be read at once. |
boolean |
nextStep()
Since there is no step in DOT, this does the same action than nextEvents() . |
void |
readAll(InputStream stream)
Read the whole file in one big non-interruptible operation. |
void |
readAll(Reader reader)
Read the whole file in one big non-interruptible operation. |
void |
readAll(String fileName)
Read the whole file in one big non-interruptible operation. |
void |
readAll(URL url)
Read the whole file in one big non-interruptible operation. |
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 |
Method Detail |
---|
public abstract ParserFactory getNewParserFactory()
public void readAll(String fileName) throws IOException
FileSource
readAll
in interface FileSource
fileName
- Name of the file to read.
IOException
- If an I/O error occurs while reading.public void readAll(URL url) throws IOException
FileSource
readAll
in interface FileSource
url
- The URL of the file to read.
IOException
- If an I/O error occurs while reading.public void readAll(InputStream stream) throws IOException
FileSource
readAll
in interface FileSource
stream
- The input stream to use for reading.
IOException
- If an I/O error occurs while reading.public void readAll(Reader reader) throws IOException
FileSource
readAll
in interface FileSource
reader
- The reader to use.
IOException
- If an I/O error occurs while reading.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
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
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
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
reader
- The file reader to use.
IOException
- If an I/O error occurs while reading.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
IOException
- If an I/O error occurs while reading.public boolean nextStep() throws IOException
nextEvents()
.
nextStep
in interface FileSource
IOException
- If an I/O error occurs while reading.public void end() throws IOException
FileSource
FileSource.nextEvents()
or
FileSource.nextStep()
did not returned false). You must call this method
after reading.
end
in interface FileSource
IOException
- If an I/O error occurs while closing the file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |