Interface Io<R extends GraphReader.ReaderBuilder,W extends GraphWriter.WriterBuilder,M extends Mapper.Builder>
-
- All Known Implementing Classes:
GraphBinaryIo,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,GraphWriterandMapper. TheIo.Builderof anIoinstance is supplied toGraph.io(Io.Builder)and theGraphimplementation can then chose to supply anIoRegistryto it before returning it. AnIoimplementation should use thatIoRegistryto lookup custom serializers to use and register them to the internalMapper(if the format has such capability).- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceIo.Builder<I extends Io>Helps to construct anIoimplementation and should be implemented by every such implementation as that class will be passed toGraph.io(Io.Builder)by the user.static classIo.Exceptions
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Mmapper()Constructs aMapper.Builderwhich is responsible for constructing the abstraction over different serialization methods.Rreader()Creates aGraphReader.ReaderBuilderimplementation .voidreadGraph(String file)voidwriteGraph(String file)Wwriter()Creates aGraphWriter.WriterBuilderimplementation .
-
-
-
Method Detail
-
reader
R reader()
Creates aGraphReader.ReaderBuilderimplementation . Implementers should call themapper()function to feed its result to the builder. In this way, custom class serializers registered to theMapper.BuilderbyGraphimplementations will end up being used for the serialization process.
-
writer
W writer()
Creates aGraphWriter.WriterBuilderimplementation . Implementers should call themapper()function to feed its result to the builder. In this way, custom class serializers registered to theMapper.BuilderbyGraphimplementations will end up being used for the serialization process.
-
mapper
M mapper()
Constructs aMapper.Builderwhich 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 toMapper.Builder.addRegistry(IoRegistry)which will provide the builder with any required custom serializers of theGraph.
-
writeGraph
void writeGraph(String file) throws IOException
- Throws:
IOException
-
readGraph
void readGraph(String file) throws IOException
- Throws:
IOException
-
-