All Known Implementing Classes:
GraphMLIo, GraphSONIo, GryoIo

public interface Io<R extends GraphReader.ReaderBuilder,W extends GraphWriter.WriterBuilder,M extends Mapper.Builder>
Ties together the core interfaces of an IO format: GraphReader, GraphWriter and Mapper. The Io.Builder of an Io instance is supplied to Graph.io(Io.Builder) and the Graph implementation can then chose to supply an IoRegistry to it before returning it. An Io implementation should use that IoRegistry to lookup custom serializers to use and register them to the internal Mapper (if the format has such capability).
Author:
Stephen Mallette (http://stephen.genoprime.com)
  • Method Details

    • reader

      R reader()
      Creates a GraphReader.ReaderBuilder implementation . Implementers should call the mapper() function to feed its result to the builder. In this way, custom class serializers registered to the Mapper.Builder by Graph implementations will end up being used for the serialization process.
    • writer

      W writer()
      Creates a GraphWriter.WriterBuilder implementation . Implementers should call the mapper() function to feed its result to the builder. In this way, custom class serializers registered to the Mapper.Builder by Graph implementations will end up being used for the serialization process.
    • mapper

      M mapper()
      Constructs a Mapper.Builder which is responsible for constructing the abstraction over different serialization methods. Implementations should set defaults as required, but most importantly need to make the appropriate call to Mapper.Builder.addRegistry(IoRegistry) which will provide the builder with any required custom serializers of the Graph.
    • writeGraph

      void writeGraph(String file) throws IOException
      Write a Graph to file using the default configuration of the writer() and its supplied mapper().
      Throws:
      IOException
    • readGraph

      void readGraph(String file) throws IOException
      Read a Graph from file using the default configuration of the reader() and its supplied mapper().
      Throws:
      IOException