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
,GraphWriter
andMapper
. TheIo.Builder
of anIo
instance is supplied toGraph.io(Io.Builder)
and theGraph
implementation can then chose to supply anIoRegistry
to it before returning it. AnIo
implementation should use thatIoRegistry
to 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 interface
Io.Builder<I extends Io>
Helps to construct anIo
implementation and should be implemented by every such implementation as that class will be passed toGraph.io(Io.Builder)
by the user.static class
Io.Exceptions
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description M
mapper()
Constructs aMapper.Builder
which is responsible for constructing the abstraction over different serialization methods.R
reader()
Creates aGraphReader.ReaderBuilder
implementation .void
readGraph(String file)
void
writeGraph(String file)
W
writer()
Creates aGraphWriter.WriterBuilder
implementation .
-
-
-
Method Detail
-
reader
R reader()
Creates aGraphReader.ReaderBuilder
implementation . Implementers should call themapper()
function to feed its result to the builder. In this way, custom class serializers registered to theMapper.Builder
byGraph
implementations will end up being used for the serialization process.
-
writer
W writer()
Creates aGraphWriter.WriterBuilder
implementation . Implementers should call themapper()
function to feed its result to the builder. In this way, custom class serializers registered to theMapper.Builder
byGraph
implementations will end up being used for the serialization process.
-
mapper
M mapper()
Constructs aMapper.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 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
-
-