Package | com.yworks.graph.model |
Class | public class YGraphAdapter |
Inheritance | YGraphAdapter Object |
Utility class that conveniently converts an IGraph
instance to a Graph
instance.
This class creates a structural copy of a given IGraph
and provides convenience methods to convert entities from one instance
to their corresponding representatives in the other instance.
See also
Property | Defined By | ||
---|---|---|---|
originalGraph : IGraph [read-only]
Gets the original graph instance. | YGraphAdapter | ||
yGraph : Graph [read-only]
Gets the graph instance that is created during the constructor call. | YGraphAdapter |
Method | Defined By | ||
---|---|---|---|
YGraphAdapter(originalGraph:IGraph)
Initializes a new instance of the YGraphAdapter class.
This will create a copy of the originalGraph that has the same structure and
makes it available via the yGraph property. | YGraphAdapter | ||
createDataMap(mapper:IMapper):DataMap
Creates a DataMap that delegates to the provided IMapper
when queried for items in the yGraph.
This method is useful where algorithms require DataMaps as input and that
input can be obtained from IMapper instances that provide and accept values
for the original nodes and edges.
| YGraphAdapter | ||
createDataProvider(mapper:IMapper):DataProvider
Creates a DataProvider that delegates to the provided IMapper
when queried for items in the yGraph.
This method is useful where algorithms require DataProviders as input
and that input can be obtained from IMapper instances that provide the
values for the original nodes and original edges.
| YGraphAdapter | ||
createEdgeIterator(el:EdgeList):Iterator
Creates an Iterator of edges that maps the edges from the EdgeList
to their original ones.
This method is useful where algorithms yield EdgeList instances as results and
the result needs to be interpreted in terms of the original graph.
| YGraphAdapter | ||
createEdgeList(edgeIt:Iterator):EdgeList
Creates an EdgeList that maps the edges from the Iterator to their
copied ones.
This method is useful where algorithms require EdgeList instances as input and those edges
are available as Iterators in the originalGraph.
| YGraphAdapter | ||
createEdgeMap(mapper:IMapper):EdgeMap
Creates an EdgeMap that delegates to the provided IMapper
when queried for Edges in the yGraph.
This method is useful where algorithms require EdgeMaps as input and this
can be mapped to corresponding IMapper instances that provide and accept values
for the original edges.
| YGraphAdapter | ||
createNodeIterator(nl:NodeList):Iterator
Creates an Iterator of nodes that maps the nodes from the NodeList
to their original ones.
This method is useful where algorithms yield NodeList instances as results and
the result needs to be interpreted in terms of the original graph.
| YGraphAdapter | ||
createNodeList(nodeIt:Iterator):NodeList
Creates an NodeList that maps the nodes from the Iterator to their copied ones.
This method is useful where algorithms require NodeList instances as input and those nodes
are available as Iterators in the originalGraph.
| YGraphAdapter | ||
createNodeMap(mapper:IMapper):NodeMap
Creates a NodeMap that delegates to the provided IMapper
when queried for Nodes in the yGraph.
This method is useful where algorithms require NodeMaps as input and this
can be mapped to corresponding IMapper instances that provide and accept values
for the original nodes.
| YGraphAdapter | ||
getCopiedEdge(e:IEdge):Edge
Yields the edge that has been created as a copy in yGraph to represent the given edge. | YGraphAdapter | ||
getCopiedNode(n:INode):Node
Yields the node that has been created as a copy in yGraph to represent the given node. | YGraphAdapter | ||
getCopy(o:Object):Object
Yields the object that has been created as a copy in yGraph to represent the given object. | YGraphAdapter | ||
getOriginal(o:Object):Object
Yields the original object from the originalGraph that the given object has been created for. | YGraphAdapter | ||
getOriginalEdge(e:Edge):IEdge
Yields the original edge from the originalGraph that the given edge has been created for. | YGraphAdapter | ||
getOriginalNode(n:Node):INode
Yields the original node from the originalGraph that the given node has been created for. | YGraphAdapter |
originalGraph | property |
originalGraph:IGraph
[read-only] Gets the original graph instance.
public function get originalGraph():IGraph
yGraph | property |
yGraph:Graph
[read-only] Gets the graph instance that is created during the constructor call.
public function get yGraph():Graph
YGraphAdapter | () | Constructor |
public function YGraphAdapter(originalGraph:IGraph)
Initializes a new instance of the YGraphAdapter
class.
This will create a copy of the originalGraph
that has the same structure and
makes it available via the yGraph
property.
originalGraph:IGraph — The original graph whose structure will be copied.
|
createDataMap | () | method |
public function createDataMap(mapper:IMapper):DataMap
Creates a DataMap
that delegates to the provided IMapper
when queried for items in the yGraph
.
This method is useful where algorithms require DataMap
s as input and that
input can be obtained from IMapper
instances that provide and accept values
for the original nodes and edges.
Parameters
mapper:IMapper — The mapper to direct requests to.
|
DataMap — A DataMap that will delegate the functionality to the mapper .
|
See also
createDataProvider | () | method |
public function createDataProvider(mapper:IMapper):DataProvider
Creates a DataProvider
that delegates to the provided IMapper
when queried for items in the yGraph
.
This method is useful where algorithms require DataProvider
s as input
and that input can be obtained from IMapper
instances that provide the
values for the original nodes and original edges.
Parameters
mapper:IMapper — The mapper to direct requests to.
|
DataProvider — A DataProvider that will delegate requests to the mapper .
|
See also
createEdgeIterator | () | method |
public function createEdgeIterator(el:EdgeList):Iterator
Creates an Iterator
of edges that maps the edges from the EdgeList
to their original ones.
This method is useful where algorithms yield EdgeList
instances as results and
the result needs to be interpreted in terms of the original graph.
Parameters
el:EdgeList — The edge list.
|
Iterator — An iterator that contains the original edges for the ones in the list.
|
See also
createEdgeList | () | method |
public function createEdgeList(edgeIt:Iterator):EdgeList
Creates an EdgeList
that maps the edges from the Iterator
to their
copied ones.
This method is useful where algorithms require EdgeList
instances as input and those edges
are available as Iterator
s in the originalGraph
.
Parameters
edgeIt:Iterator — The edges from the originalGraph .
|
EdgeList — An EdgeList that contains the copied edges for the ones in the iterator.
|
See also
createEdgeMap | () | method |
public function createEdgeMap(mapper:IMapper):EdgeMap
Creates an EdgeMap
that delegates to the provided IMapper
when queried for Edge
s in the yGraph
.
This method is useful where algorithms require EdgeMap
s as input and this
can be mapped to corresponding IMapper
instances that provide and accept values
for the original edges.
Parameters
mapper:IMapper — The mapper to direct requests to.
|
EdgeMap — An EdgeMap that will delegate the functionality to the mapper .
|
See also
createNodeIterator | () | method |
public function createNodeIterator(nl:NodeList):Iterator
Creates an Iterator
of nodes that maps the nodes from the NodeList
to their original ones.
This method is useful where algorithms yield NodeList
instances as results and
the result needs to be interpreted in terms of the original graph.
Parameters
nl:NodeList — The node list.
|
Iterator — An iterator that contains the original nodes for the ones in the list.
|
See also
createNodeList | () | method |
public function createNodeList(nodeIt:Iterator):NodeList
Creates an NodeList
that maps the nodes from the Iterator
to their copied ones.
This method is useful where algorithms require NodeList
instances as input and those nodes
are available as Iterator
s in the originalGraph
.
Parameters
nodeIt:Iterator — The nodes from the originalGraph .
|
NodeList — An NodeList that contains the copied nodes for the ones in the iterator.
|
See also
createNodeMap | () | method |
public function createNodeMap(mapper:IMapper):NodeMap
Creates a NodeMap
that delegates to the provided IMapper
when queried for Node
s in the yGraph
.
This method is useful where algorithms require NodeMap
s as input and this
can be mapped to corresponding IMapper
instances that provide and accept values
for the original nodes.
Parameters
mapper:IMapper — The mapper to direct requests to.
|
NodeMap — A NodeMap that will delegate the functionality to the mapper .
|
See also
getCopiedEdge | () | method |
public function getCopiedEdge(e:IEdge):Edge
Yields the edge that has been created as a copy in yGraph
to represent the given edge.
Parameters
e:IEdge — The edge for which the representation is returned.
|
Edge — The edge that represents e in yGraph .
|
See also
getCopiedNode | () | method |
public function getCopiedNode(n:INode):Node
Yields the node that has been created as a copy in yGraph
to represent the given node.
Parameters
n:INode — The node for which the representation is returned.
|
Node — The node that represents n in yGraph .
|
See also
getCopy | () | method |
public function getCopy(o:Object):Object
Yields the object that has been created as a copy in yGraph
to represent the given object.
Parameters
o:Object — The object for which the representation is returned.
|
Object — The object that represents o in yGraph .
|
See also
getOriginal | () | method |
public function getOriginal(o:Object):Object
Yields the original object from the originalGraph
that the given object has been created for.
Parameters
o:Object — The object for which the original instance will be returned.
|
Object — The original instance.
|
See also
getOriginalEdge | () | method |
public function getOriginalEdge(e:Edge):IEdge
Yields the original edge from the originalGraph
that the given edge has been created for.
Parameters
e:Edge — The edge for which the original instance will be returned.
|
IEdge — The original instance.
|
See also
getOriginalNode | () | method |
public function getOriginalNode(n:Node):INode
Yields the original node from the originalGraph
that the given node has been created for.
Parameters
n:Node — The node for which the original instance will be returned.
|
INode — The original instance.
|
See also