Search this API

y.util
Class GraphCopier.DataProviderCopyFactory

java.lang.Object
  extended by y.util.GraphCopier.GraphDataCopyFactory
      extended by y.util.GraphCopier.DataProviderCopyFactory
All Implemented Interfaces:
GraphCopier.CopyFactory
Direct Known Subclasses:
GraphCopier.EdgeDataProviderCopyFactory, GraphCopier.ItemDataProviderCopyFactory, GraphCopier.NodeDataProviderCopyFactory
Enclosing class:
GraphCopier

public abstract static class GraphCopier.DataProviderCopyFactory
extends GraphCopier.GraphDataCopyFactory

Abstract helper class that provides helper methods to copy DataProvider contents.

 

Field Summary
protected  java.lang.Object dpKey
          The DataProvider key.
 
Constructor Summary
protected GraphCopier.DataProviderCopyFactory(GraphCopier.CopyFactory delegatingFactory, java.lang.Object dpKey)
          Creates a new delegating instance that copies the data for the given data provider key.
 
Method Summary
protected abstract  DataMap createMap(Graph dst)
          Factory callback to create the backing storage.
protected  DataMap getMap(Graph graph)
          Helper method that retrieves the map for the given graph instance.
protected  void preCopyData(Graph src, Graph dst)
          Calls createMap(y.base.Graph) and registers that map on the target graph if there is no DataMap registered on the target graph yet.
 
Methods inherited from class y.util.GraphCopier.GraphDataCopyFactory
copyData, copyData, copyEdge, copyNode, createGraph, postCopyData, postCopyGraphData, preCopyGraphData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dpKey

protected final java.lang.Object dpKey
The DataProvider key.

Constructor Detail

GraphCopier.DataProviderCopyFactory

protected GraphCopier.DataProviderCopyFactory(GraphCopier.CopyFactory delegatingFactory,
                                              java.lang.Object dpKey)
Creates a new delegating instance that copies the data for the given data provider key.

Parameters:
delegatingFactory - the factory to delegate to.
dpKey - the data provider key
Method Detail

preCopyData

protected void preCopyData(Graph src,
                           Graph dst)
Calls createMap(y.base.Graph) and registers that map on the target graph if there is no DataMap registered on the target graph yet.

Overrides:
preCopyData in class GraphCopier.GraphDataCopyFactory

createMap

protected abstract DataMap createMap(Graph dst)
Factory callback to create the backing storage.


getMap

protected DataMap getMap(Graph graph)
Helper method that retrieves the map for the given graph instance.

Parameters:
graph - Graph instance for which the map is retrieved
Returns:
the map for the given graph instance

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.