public interface GraphReader
Modifier and Type | Method and Description |
---|---|
Edge |
readEdge(InputStream inputStream,
Function<DetachedEdge,Edge> edgeMaker)
Reads a single edge from an
InputStream . |
void |
readGraph(InputStream inputStream,
Graph graphToWriteTo)
Reads an entire graph from an
InputStream . |
Vertex |
readVertex(InputStream inputStream,
Direction direction,
Function<DetachedVertex,Vertex> vertexMaker,
Function<DetachedEdge,Edge> edgeMaker)
Reads a single vertex from an
InputStream . |
Vertex |
readVertex(InputStream inputStream,
Function<DetachedVertex,Vertex> vertexMaker)
Reads a single vertex from an
InputStream . |
Iterator<Vertex> |
readVertices(InputStream inputStream,
Direction direction,
Function<DetachedVertex,Vertex> vertexMaker,
Function<DetachedEdge,Edge> edgeMaker)
Reads a set of vertices from an
InputStream which were written by
GraphWriter.writeVertices(java.io.OutputStream, org.apache.tinkerpop.gremlin.process.traversal.Traversal) . |
void readGraph(InputStream inputStream, Graph graphToWriteTo) throws IOException
InputStream
.inputStream
- a stream containing a single vertex as defined by the accompanying GraphWriter
IOException
Vertex readVertex(InputStream inputStream, Function<DetachedVertex,Vertex> vertexMaker) throws IOException
InputStream
. This method will read vertex properties but not edges.inputStream
- a stream containing a single vertex as defined by the accompanying GraphWriter
vertexMaker
- a function to create a vertex where the first argument is the vertex identifier, the
second argument is vertex label and the last is the list of properties for itIOException
Vertex readVertex(InputStream inputStream, Direction direction, Function<DetachedVertex,Vertex> vertexMaker, Function<DetachedEdge,Edge> edgeMaker) throws IOException
InputStream
. This method will read vertex properties as well as edges
given the direction supplied as an argument.inputStream
- a stream containing a single vertex as defined by the accompanying GraphWriter
direction
- the direction of edges to read.vertexMaker
- a function to create a vertex where the first argument is the vertex identifier, the
second argument is vertex label and the last is the list of properties for itedgeMaker
- a function that creates an edge from the stream where the first argument is the edge
identifier, the second argument is the out vertex id, the third is the in vertex id,
the fourth is the label, and the fifth is the list of properties as key/value pairs.IOException
Iterator<Vertex> readVertices(InputStream inputStream, Direction direction, Function<DetachedVertex,Vertex> vertexMaker, Function<DetachedEdge,Edge> edgeMaker) throws IOException
InputStream
which were written by
GraphWriter.writeVertices(java.io.OutputStream, org.apache.tinkerpop.gremlin.process.traversal.Traversal)
. This method
will read vertex properties as well as edges given the direction supplied as an argument.inputStream
- a stream containing a single vertex as defined by the accompanying GraphWriter
direction
- the direction of edges to read.vertexMaker
- a function to create a vertex where the first argument is the vertex identifier, the
second argument is vertex label and the last is the list of properties for itedgeMaker
- a function that creates an edge from the stream where the first argument is the edge
identifier, the second argument is the out vertex id, the third is the in vertex id,
the fourth is the label, and the fifth is the list of properties as key/value pairs.IOException
Edge readEdge(InputStream inputStream, Function<DetachedEdge,Edge> edgeMaker) throws IOException
InputStream
.inputStream
- a stream containing a single vertex as defined by the accompanying GraphWriter
edgeMaker
- a function that creates an edge from the stream where the first argument is the edge
identifier, the second argument is the out vertex id, the third is the in vertex id,
the fourth is the label, and the fifth is the list of properties as key/value pairs.IOException
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.