Interface GraphReader<V>

  • Type Parameters:
    V - the vertex type
    All Known Implementing Classes:
    GraphJson

    public interface GraphReader<V>

    Common interface for reading graphs from resources.

    Readers first read in the graph constructing intermediate Vertex objects to represent vertices and their properties. Vertex objects are then decoded into an actual vertex using a supplied VertexDecoder. Similarly, edges are constructed using the graph's edge factory, but an EdgeDecoder is used to add additional properties stored in a map to the edge.

    Author:
    David B. Bracewell
    • Method Detail

      • setVertexDecoder

        void setVertexDecoder​(VertexDecoder<V> vertexDecoder)
        Sets the vertex decoder.
        Parameters:
        vertexDecoder - the vertex decoder
      • setEdgeDecoder

        void setEdgeDecoder​(EdgeDecoder<V> edgeDecoder)
        Sets the edge decoder.
        Parameters:
        edgeDecoder - the edge decoder
      • read

        Graph<V> read​(Resource location)
               throws IOException
        Reads a graph in from a resource
        Parameters:
        location - the location of the graph
        Returns:
        A Graph constructed based on the resource
        Throws:
        IOException - Something went wrong reading