public abstract class GraphTransferProtocol<V extends Vertex,E extends Edge>
extends java.lang.Object
GraphTransferProtocol
and override getTransferData(Vertex)
and getTransferData(Edge)
.
In this methods you decide what data and which parts of the data should be transferred.
DefaultTransferProtocol
,
VertexOnlyTransferProtocol
Modifier and Type | Class and Description |
---|---|
class |
GraphTransferProtocol.TransferData
Represents a storage for the properties of an object that should be transfered
from one graph view to another.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
clearExistingGraph
flag that indicates whether an existing graph should be cleared before the data is transferred
|
protected Graph<V,E> |
graph
the related graph
|
protected GraphView<V,E> |
graphView
the graph view its graph should be transferred
|
Constructor and Description |
---|
GraphTransferProtocol(GraphView<V,E> graphView,
boolean clearExistingGraph)
Creates a new graph transfer protocol.
|
Modifier and Type | Method and Description |
---|---|
Graph<V,E> |
getGraph()
Gets the graph that should be transferred.
|
GraphView<V,E> |
getGraphView()
Gets the graph view its graph should be transferred.
|
protected abstract GraphTransferProtocol.TransferData |
getTransferData(E edge)
Gets the transfer data for a given edge.
|
protected abstract GraphTransferProtocol.TransferData |
getTransferData(V vertex)
Gets the transfer data for a given vertex.
|
boolean |
prepare()
Prepares the protocol.
|
protected final GraphView<V extends Vertex,E extends Edge> graphView
protected final boolean clearExistingGraph
public GraphTransferProtocol(GraphView<V,E> graphView, boolean clearExistingGraph) throws java.lang.IllegalArgumentException
graphView
- the graph view its graph should be transferredclearExistingGraph
- true
if the graph of the view the data is transferred to should be cleared otherwise false
java.lang.IllegalArgumentException
- public final GraphView<V,E> getGraphView()
public final Graph<V,E> getGraph()
public final boolean prepare()
GraphView
changes its graph data structure using GraphView.setGraph(Graph)
.true
if the protocol could be prepared otherwise false
(a reason might be that you have already prepared the protocol before)protected abstract GraphTransferProtocol.TransferData getTransferData(V vertex)
vertex
- a vertex of the graphnull
if the object should not be transferedprotected abstract GraphTransferProtocol.TransferData getTransferData(E edge)
edge
- an edge of the graphnull
if the object should not be transfered