|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.util.GraphCopier.GraphDataCopyFactory
public abstract static class GraphCopier.GraphDataCopyFactory
An abstract base implementation of a delegating GraphCopier.GraphDataCopyFactory
that
copies data for items being copied. The actual copying will be performed
by the wrapped delegate. Instances of this class should be used to wrap
existing copy factories.
Subclasses should override any or all of the
copyData(y.base.Node,y.base.Node)
,
copyData(y.base.Edge,y.base.Edge)
,
preCopyData(y.base.Graph,y.base.Graph)
, and
postCopyData(y.base.Graph,y.base.Graph,java.util.Map,java.util.Map)
methods.
Constructor Summary | |
---|---|
protected |
GraphCopier.GraphDataCopyFactory(GraphCopier.CopyFactory delegatingFactory)
Creates a new instance that delegates the actual copying process of the elements to the provided factory. |
Method Summary | |
---|---|
protected void |
copyData(Edge src,
Edge dst)
Empty stub to be overwritten by subclass implementations. |
protected void |
copyData(Node src,
Node dst)
Empty stub to be overwritten by subclass implementations. |
Edge |
copyEdge(Graph graph,
Node source,
Node target,
Edge hint)
Delegates the copying of the data to copyData(y.base.Edge,y.base.Edge) |
Node |
copyNode(Graph graph,
Node hint)
Delegates the copying of the data to copyData(y.base.Node,y.base.Node) |
Graph |
createGraph()
Creates a new graph instance that will be the target graph of the copy operation. |
protected void |
postCopyData(Graph src,
Graph dst,
java.util.Map nodeMap,
java.util.Map edgeMap)
Empty stub to be overwritten by subclass implementations. |
void |
postCopyGraphData(Graph srcGraph,
Graph newGraph,
java.util.Map nodeMap,
java.util.Map edgeMap)
Calls the delegate and then postCopyData(y.base.Graph,y.base.Graph,java.util.Map,java.util.Map) . |
protected void |
preCopyData(Graph src,
Graph dst)
Empty stub to be overwritten by subclass implementations. |
void |
preCopyGraphData(Graph srcGraph,
Graph newGraph)
Calls preCopyData(y.base.Graph,y.base.Graph) and then the delegate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected GraphCopier.GraphDataCopyFactory(GraphCopier.CopyFactory delegatingFactory)
delegatingFactory
- Method Detail |
---|
public void preCopyGraphData(Graph srcGraph, Graph newGraph)
preCopyData(y.base.Graph,y.base.Graph)
and then the delegate.
preCopyGraphData
in interface GraphCopier.CopyFactory
srcGraph
- the graph that will be used to copy the entities from.newGraph
- the graph that will be used to copy the entities to.public void postCopyGraphData(Graph srcGraph, Graph newGraph, java.util.Map nodeMap, java.util.Map edgeMap)
postCopyData(y.base.Graph,y.base.Graph,java.util.Map,java.util.Map)
.
postCopyGraphData
in interface GraphCopier.CopyFactory
srcGraph
- the graph that was used to copy the entities from.newGraph
- the graph that was used to copy the entities to.nodeMap
- a map that contains a mapping between the nodes in the source graph
to their corresponding nodes in the new graph.edgeMap
- a map that contains a mapping between the edges in the source graph
to their corresponding edges in the new graph.public Node copyNode(Graph graph, Node hint)
copyData(y.base.Node,y.base.Node)
copyNode
in interface GraphCopier.CopyFactory
graph
- the graph to create the new node inhint
- the original node from the source graph
public Graph createGraph()
GraphCopier.CopyFactory
createGraph
in interface GraphCopier.CopyFactory
protected void preCopyData(Graph src, Graph dst)
protected void postCopyData(Graph src, Graph dst, java.util.Map nodeMap, java.util.Map edgeMap)
nodeMap
- a Map that maps old node instances to their new copiesedgeMap
- a Map that maps old edge instances to their new copiesprotected void copyData(Node src, Node dst)
src
- the old entitydst
- the new entityprotected void copyData(Edge src, Edge dst)
src
- the old entitydst
- the new entitypublic Edge copyEdge(Graph graph, Node source, Node target, Edge hint)
copyData(y.base.Edge,y.base.Edge)
copyEdge
in interface GraphCopier.CopyFactory
graph
- the graph to create the new node insource
- the source node in the target graph to use for the newly created edgetarget
- the target node in the target graph to use for the newly created edgehint
- the original edge from the source graph
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |