V
- the type of the verticesE
- the type of the edgespublic class DefaultTransferProtocol<V extends Vertex,E extends Edge> extends GraphTransferProtocol<V,E>
GraphTransferProtocol
that makes it possible to transfer a graph of one graph view to another
or to the same.
// create the GTP and prepare it final DefaultGraphTransferProtocol<Vertex, Edge> gtp = new DefaultGraphTransferProtocol<Vertex, Edge>(myGraphView); gtp.prepare(); // change the type of the graph view to a mixed graph myGraphView.setGraph(new Graph(Type.MIXED)); // afterwards transfer the data of the old graph to the mixed graph myGraphView.transferGraph(gtp);
VertexOnlyTransferProtocol
GraphTransferProtocol.TransferData
clearExistingGraph, graph, graphView
Constructor and Description |
---|
DefaultTransferProtocol(GraphView<V,E> graphView,
boolean clearExistingGraph)
Creates a new default transfer protocol.
|
Modifier and Type | Method and Description |
---|---|
protected GraphTransferProtocol.TransferData |
getTransferData(E edge)
Gets the transfer data for a given edge.
|
protected GraphTransferProtocol.TransferData |
getTransferData(V vertex)
Gets the transfer data for a given vertex.
|
getGraph, getGraphView, prepare
public DefaultTransferProtocol(GraphView<V,E> graphView, boolean clearExistingGraph) throws java.lang.NullPointerException
graphView
- the graph view its graph should be transferedclearExistingGraph
- true
if the graph of the view the data is transferred to should be cleared otherwise false
java.lang.NullPointerException
- protected GraphTransferProtocol.TransferData getTransferData(V vertex)
GraphTransferProtocol
getTransferData
in class GraphTransferProtocol<V extends Vertex,E extends Edge>
vertex
- a vertex of the graphnull
if the object should not be transferedprotected GraphTransferProtocol.TransferData getTransferData(E edge)
GraphTransferProtocol
getTransferData
in class GraphTransferProtocol<V extends Vertex,E extends Edge>
edge
- an edge of the graphnull
if the object should not be transfered