G
- the type of the (root element of) graphN
- the type of the nodesM
- the type of the methodspublic static final class GraphOutput.Builder<G,N,M> extends Object
GraphOutput
.Modifier and Type | Method and Description |
---|---|
GraphOutput.Builder<G,N,M> |
attr(String name,
Object value)
Attaches metadata to the dump.
|
GraphOutput.Builder<G,N,M> |
blocks(GraphBlocks<G,?,N> graphBlocks)
Associates implementation of blocks.
|
GraphOutput<G,M> |
build(GraphOutput<?,?> parent)
Support for nesting heterogenous graphs.
|
GraphOutput<G,M> |
build(WritableByteChannel channel)
Creates new
GraphOutput to output to provided channel. |
<E,P> GraphOutput.Builder<G,N,E> |
elements(GraphElements<E,?,?,P> graphElements)
Associates implementation of graph elements.
|
<E,P> GraphOutput.Builder<G,N,E> |
elementsAndLocations(GraphElements<E,?,?,P> graphElements,
GraphLocations<E,P,?> graphLocations)
Associates implementation of graph elements and an advanced way to interpret their
locations.
|
GraphOutput.Builder<G,N,M> |
embedded(boolean embedded)
Sets
GraphOutput as embedded. |
GraphOutput.Builder<G,N,M> |
protocolVersion(int majorVersion,
int minorVersion)
Chooses which version of the protocol to use.
|
GraphOutput.Builder<G,N,M> |
types(GraphTypes graphTypes)
Associates different implementation of types.
|
public GraphOutput.Builder<G,N,M> protocolVersion(int majorVersion, int minorVersion)
7.0
(when the GraphOutput
& co. classes were introduced). The default can be changed
to other known versions manually by calling this method.
Note: the the default version is 7.0 since version 20.2. Previous versions used default version 4.0
majorVersion
- by default 7, newer version may be knownminorVersion
- usually 0public GraphOutput.Builder<G,N,M> embedded(boolean embedded)
GraphOutput
as embedded. The embedded GraphOutput
shares
channel
with another already open non parent
GraphOutput
. The embedded GraphOutput
flushes data after each
print
, beginGroup
and
endGroup
call.embedded
- if true
the builder creates an embedded GraphOutput
public GraphOutput.Builder<G,N,M> types(GraphTypes graphTypes)
graphTypes
- implementation of types and enum recognitionpublic GraphOutput.Builder<G,N,M> blocks(GraphBlocks<G,?,N> graphBlocks)
graphBlocks
- the blocks implementationpublic <E,P> GraphOutput.Builder<G,N,E> elements(GraphElements<E,?,?,P> graphElements)
graphElements
- the elements implementationpublic <E,P> GraphOutput.Builder<G,N,E> elementsAndLocations(GraphElements<E,?,?,P> graphElements, GraphLocations<E,P,?> graphLocations)
graphElements
- the elements implementationgraphLocations
- the locations for the elementspublic GraphOutput.Builder<G,N,M> attr(String name, Object value)
name
- key namevalue
- value for the keypublic GraphOutput<G,M> build(WritableByteChannel channel) throws IOException
GraphOutput
to output to provided channel. The output will use
interfaces currently associated with this builder.channel
- the channel to output toIOException
- if something goes wrong when writing to the channelpublic GraphOutput<G,M> build(GraphOutput<?,?> parent)
parent
the output
channel
, internal constant pool and protocol
version
.
Both GraphOutput (the parent
and the returned one) has to be used in
synchronization - e.g. only one
begin
, end
of group or
printing
can be on at a given moment.
parent
- the output to inherit channel
and protocol version fromchannel
and other internals with parent