public interface GraphWriter
writeVertex(OutputStream, Vertex)
} need not have equivalent output to
writeObject(OutputStream, Object)
. Nor does the representation of an Edge
within the output of
writeVertex(OutputStream, Vertex, Direction)
need to match the representation of that same
Edge
when provided to writeEdge(OutputStream, Edge)
. In other words, implementations are free
to optimize as is possible for a specific serialization method.
That said, it is however important that the complementary "read" operation in GraphReader
be capable of
reading the output of the writer. In other words, the output of writeObject(OutputStream, Object)
should always be readable by GraphReader.readObject(InputStream, Class)
and the output of
writeGraph(OutputStream, Graph)
should always be readable by
GraphReader.readGraph(InputStream, Graph)
.Modifier and Type | Interface and Description |
---|---|
static interface |
GraphWriter.WriterBuilder<T extends GraphWriter>
Largely a marker interface for builder classes that construct a
GraphWriter . |
Modifier and Type | Method and Description |
---|---|
void |
writeEdge(OutputStream outputStream,
Edge e)
Write an edge to a stream.
|
void |
writeGraph(OutputStream outputStream,
Graph g)
Write the entire graph to a stream.
|
void |
writeObject(OutputStream outputStream,
Object object)
Writes an arbitrary object to the stream.
|
void |
writeProperty(OutputStream outputStream,
Property p)
Write a property to a stream.
|
void |
writeVertex(OutputStream outputStream,
Vertex v)
Write a vertex to a stream without writing its edges.
|
void |
writeVertex(OutputStream outputStream,
Vertex v,
Direction direction)
Write a vertex to a stream with its associated edges.
|
void |
writeVertexProperty(OutputStream outputStream,
VertexProperty vp)
Write a vertex property to a stream.
|
default void |
writeVertices(OutputStream outputStream,
Iterator<Vertex> vertexIterator)
Write a vertex to a stream without writing its edges.
|
default void |
writeVertices(OutputStream outputStream,
Iterator<Vertex> vertexIterator,
Direction direction)
Write a list of vertices from a
Traversal to a stream with its associated edges. |
void writeGraph(OutputStream outputStream, Graph g) throws IOException
outputStream
- the stream to write to.g
- the graph to write to stream.IOException
void writeVertex(OutputStream outputStream, Vertex v, Direction direction) throws IOException
outputStream
- the stream to write to.v
- the vertex to write.direction
- the direction of edges to write or null if no edges are to be written.IOException
void writeVertex(OutputStream outputStream, Vertex v) throws IOException
outputStream
- the stream to write to.v
- the vertex to write.IOException
default void writeVertices(OutputStream outputStream, Iterator<Vertex> vertexIterator, Direction direction) throws IOException
Traversal
to a stream with its associated edges. Only write edges as
defined by the requested direction.outputStream
- the stream to write to.vertexIterator
- a traversal that returns a list of vertices.direction
- the direction of edges to write or null if no edges are to be written.IOException
default void writeVertices(OutputStream outputStream, Iterator<Vertex> vertexIterator) throws IOException
outputStream
- the stream to write to.vertexIterator
- a iterator that returns a list of vertices.IOException
void writeEdge(OutputStream outputStream, Edge e) throws IOException
outputStream
- the stream to write to.e
- the edge to write.IOException
void writeVertexProperty(OutputStream outputStream, VertexProperty vp) throws IOException
outputStream
- the stream to write to.vp
- the vertex property to write.IOException
void writeProperty(OutputStream outputStream, Property p) throws IOException
outputStream
- the stream to write to.p
- the property to write.IOException
void writeObject(OutputStream outputStream, Object object) throws IOException
outputStream
- the stream to write to.object
- the object to write which will use the standard serializer set.IOException
Copyright © 2013–2023 Apache Software Foundation. All rights reserved.