Package org.graphstream.stream.file
Class FileSinkGEXF2
java.lang.Object
org.graphstream.stream.SourceBase
org.graphstream.stream.PipeBase
org.graphstream.stream.file.FileSinkGEXF2
- All Implemented Interfaces:
AttributeSink
,ElementSink
,FileSink
,Pipe
,Sink
,Source
public class FileSinkGEXF2 extends PipeBase implements FileSink
-
Nested Class Summary
Nested classes/interfaces inherited from class org.graphstream.stream.SourceBase
SourceBase.ElementType
-
Constructor Summary
Constructors Constructor Description FileSinkGEXF2()
-
Method Summary
Modifier and Type Method Description void
begin(OutputStream stream)
Begin the output of the given stream of graph events.void
begin(Writer writer)
Begin the output of the given stream of graph events.void
begin(String fileName)
Begin the output of the given stream of graph events.void
end()
End the writing process started withFileSink.begin(OutputStream)
orFileSink.begin(String)
.void
flush()
Ensure all data sent to the output are correctly written.void
writeAll(Graph graph, OutputStream stream)
Write the current graph state in one big non-interruptible operation.void
writeAll(Graph graph, Writer writer)
Write the current graph state in one big non-interruptible operation.void
writeAll(Graph graph, String fileName)
Write the current graph state in one big non-interruptible operation.Methods inherited from class org.graphstream.stream.PipeBase
edgeAdded, edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, edgeRemoved, graphAttributeAdded, graphAttributeChanged, graphAttributeRemoved, graphCleared, nodeAdded, nodeAttributeAdded, nodeAttributeChanged, nodeAttributeRemoved, nodeRemoved, stepBegins
Methods inherited from class org.graphstream.stream.SourceBase
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, 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
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.graphstream.stream.AttributeSink
edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, graphAttributeAdded, graphAttributeChanged, graphAttributeRemoved, nodeAttributeAdded, nodeAttributeChanged, nodeAttributeRemoved
Methods inherited from interface org.graphstream.stream.ElementSink
edgeAdded, edgeRemoved, graphCleared, nodeAdded, nodeRemoved, stepBegins
Methods inherited from interface org.graphstream.stream.Source
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
-
Constructor Details
-
FileSinkGEXF2
public FileSinkGEXF2()
-
-
Method Details
-
writeAll
Description copied from interface:FileSink
Write the current graph state in one big non-interruptible operation. This operation is a "snapshot" of the graph, it will never convey the dynamics of the graph. To ensure you store the graph "as it evolves in time" you must use theFileSink.begin(OutputStream)
orFileSink.begin(String)
as soon as the graph appears (or any source of graph event, any descendant ofSource
will do).- Specified by:
writeAll
in interfaceFileSink
- Parameters:
graph
- The graph to send as events to the file.fileName
- Name of the file to write.- Throws:
IOException
- if an I/O error occurs while writing.
-
writeAll
Description copied from interface:FileSink
Write the current graph state in one big non-interruptible operation. This operation is a "snapshot" of the graph, it will never convey the dynamics of the graph. To ensure you store the graph "as it evolves in time" you must use theFileSink.begin(Writer)
orFileSink.begin(OutputStream)
orFileSink.begin(String)
as soon as the graph appears (or any source of graph event, any descendant ofSource
will do).- Specified by:
writeAll
in interfaceFileSink
- Parameters:
graph
- The graph to send as events to the file.stream
- The stream where the graph is sent.- Throws:
IOException
- if an I/O error occurs while writing.
-
writeAll
Description copied from interface:FileSink
Write the current graph state in one big non-interruptible operation. This operation is a "snapshot" of the graph, it will never convey the dynamics of the graph. To ensure you store the graph "as it evolves in time" you must use theFileSink.begin(Writer)
orFileSink.begin(OutputStream)
orFileSink.begin(String)
as soon as the graph appears (or any source of graph event, any descendant ofSource
will do).- Specified by:
writeAll
in interfaceFileSink
- Parameters:
graph
- The graph to send as events to the file.writer
- The writer where the graph is sent.- Throws:
IOException
- if an I/O error occurs while writing.
-
begin
Description copied from interface:FileSink
Begin the output of the given stream of graph events. The graph events can come from any input (implementation ofSource
or you can directly use the methods inherited fromSink
. Once the writing is started using begin(), you must close it usingFileSink.end()
when done to ensure data is correctly stored in the file.- Specified by:
begin
in interfaceFileSink
- Parameters:
fileName
- The name of the file where to output the graph events.- Throws:
IOException
- If an I/O error occurs while writing.
-
begin
Description copied from interface:FileSink
Begin the output of the given stream of graph events. The graph events can come from any input (implementation ofSource
or you can directly use the methods inherited fromSink
. Once the writing is started using begin(), you must close it usingFileSink.end()
when done to ensure data is correctly stored in the file.- Specified by:
begin
in interfaceFileSink
- Parameters:
stream
- The file stream where to output the graph events.- Throws:
IOException
- If an I/O error occurs while writing.
-
begin
Description copied from interface:FileSink
Begin the output of the given stream of graph events. The graph events can come from any input (implementation ofSource
or you can directly use the methods inherited fromSink
. Once the writing is started using begin(), you must close it usingFileSink.end()
when done to ensure data is correctly stored in the file.- Specified by:
begin
in interfaceFileSink
- Parameters:
writer
- The writer where to output the graph events.- Throws:
IOException
- If an I/O error occurs while writing.
-
flush
Description copied from interface:FileSink
Ensure all data sent to the output are correctly written.- Specified by:
flush
in interfaceFileSink
- Throws:
IOException
- If an I/O error occurs during write.
-
end
Description copied from interface:FileSink
End the writing process started withFileSink.begin(OutputStream)
orFileSink.begin(String)
.- Specified by:
end
in interfaceFileSink
- Throws:
IOException
-