| Package | com.yworks.yfiles.base |
| Class | public class Edge |
| Inheritance | Edge com.yworks.yfiles.base.GraphObject |
true.
Important: Class Graph is the single authority for any structural changes to the graph data type. Specifically, this means that there is no way to create or delete a node or an edge without using an actual Graph instance.
See also
| Property | Defined By | ||
|---|---|---|---|
| graph : Graph [read-only]
Returns the graph this edge belongs to. | Edge | ||
| selfLoop : Boolean [read-only]
Returns true if and only if this edge is a self-loop. | Edge | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a new edge that belongs to the given graph. | Edge | ||
Creates a copy of this edge that will be inserted into the given graph connecting the given source and target nodes. | Edge | ||
getClass():Class [override] | Edge | ||
index():int
Returns the index of this edge within its graph G. | Edge | ||
Returns the successor of this edge in the list of incoming edges at its target node. | Edge | ||
Returns the successor of this edge in the list of outgoing edges at its source node. | Edge | ||
Returns the node at the opposite edge end with respect to the given node. | Edge | ||
Returns the predecessor of this edge in the list of incoming edges at its target node. | Edge | ||
Returns the predecessor of this edge in the list of outgoing edges at its source node. | Edge | ||
Returns the source node connected to this edge. | Edge | ||
Returns the target node connected to this edge. | Edge | ||
toString():String
Returns a String representation of this edge. | Edge | ||
| Method | Defined By | ||
|---|---|---|---|
Initializes this object. | Edge | ||
[static]
Creates a new edge that belongs to the given graph. | Edge | ||
onReinsert():void
Callback method that is invoked from a graph just before this edge will be reinserted into that graph. | Edge | ||
| graph | property |
graph:Graph [read-only]
Returns the graph this edge belongs to.
If the edge does not belong to a graph, because it was removed or hidden from it, this method returns null.
public function get graph():Graph| selfLoop | property |
selfLoop:Boolean [read-only]
Returns true if and only if this edge is a self-loop.
An edge is called a self-loop, if it is adjacent to only one node, i.e., source node and target node are the same.
public function get selfLoop():Boolean| Edge | () | Constructor |
public function Edge(g:Graph, v:Node, e1:Edge, w:Node, e2:Edge, d1:int, d2:int, init:Boolean = true)
Creates a new edge that belongs to the given graph.
The new edge e has source node v and target node w. Edge e is inserted in such a way that an iteration over the edges at node v returns e
e1, if d1 == AFTER e1, if d1 == BEFORE, w returns e e2, if d2 == AFTER e2, if d2 == BEFORE. Precondition Edge e1 must have source node v and edge e2 must have target node w.
g:Graph | |
v:Node — The source node of the edge.
| |
e1:Edge — An edge with source node v.
| |
w:Node — The target node of the edge.
| |
e2:Edge — An edge with target node w.
| |
d1:int — One of the object insertion specifiers com.yworks.yfiles.base.Graph.BEFORE or com.yworks.yfiles.base.Graph.AFTER .
| |
d2:int — One of the object insertion specifiers com.yworks.yfiles.base.Graph.BEFORE or com.yworks.yfiles.base.Graph.AFTER .
| |
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
See also
| createCopy | () | method |
public function createCopy(g:Graph, v:Node, w:Node):EdgeCreates a copy of this edge that will be inserted into the given graph connecting the given source and target nodes.
Parameters
g:Graph — The graph the created edge will belong to.
| |
v:Node — The source node of the created edge.
| |
w:Node — The target node of the created edge.
|
Edge — The newly created Edge object.
|
| getClass | () | method |
override public function getClass():ClassReturnsClass |
| index | () | method |
public function index():int
Returns the index of this edge within its graph G.
Edge indices represent the ordering of standard edge iteration on G. The value of an index is >= 0 and < G.edgeCount().
Precondition This edge must belong to some graph.
Returnsint |
See also
| initEdge | () | method |
protected final function initEdge(g:Graph, v:Node, e1:Edge, w:Node, e2:Edge, d1:int, d2:int):void
Initializes this object. See the documentation of the corresponding factory method newEdge() for details.
Parameters
g:Graph | |
v:Node | |
e1:Edge | |
w:Node | |
e2:Edge | |
d1:int | |
d2:int |
See also
| newEdge | () | method |
protected static function newEdge(g:Graph, v:Node, e1:Edge, w:Node, e2:Edge, d1:int, d2:int):Edge
Creates a new edge that belongs to the given graph.
The new edge e has source node v and target node w. Edge e is inserted in such a way that an iteration over the edges at node v returns e
e1, if d1 == AFTER e1, if d1 == BEFORE, w returns e e2, if d2 == AFTER e2, if d2 == BEFORE. Precondition Edge e1 must have source node v and edge e2 must have target node w.
Parameters
g:Graph | |
v:Node — The source node of the edge.
| |
e1:Edge — An edge with source node v.
| |
w:Node — The target node of the edge.
| |
e2:Edge — An edge with target node w.
| |
d1:int — One of the object insertion specifiers com.yworks.yfiles.base.Graph.BEFORE or com.yworks.yfiles.base.Graph.AFTER .
| |
d2:int — One of the object insertion specifiers com.yworks.yfiles.base.Graph.BEFORE or com.yworks.yfiles.base.Graph.AFTER .
|
Edge |
See also
| nextInEdge | () | method |
public function nextInEdge():Edge
Returns the successor of this edge in the list of incoming edges at its target node.
If this edge is the last incoming edge at its target node, then null is returned.
Precondition This edge must belong to some graph.
ReturnsEdge |
See also
| nextOutEdge | () | method |
public function nextOutEdge():Edge
Returns the successor of this edge in the list of outgoing edges at its source node.
If this edge is the last outgoing edge at its source node, then null is returned.
Precondition This edge must belong to some graph.
ReturnsEdge |
See also
| onReinsert | () | method |
protected function onReinsert():voidCallback method that is invoked from a graph just before this edge will be reinserted into that graph.
| opposite | () | method |
public function opposite(v:Node):NodeReturns the node at the opposite edge end with respect to the given node.
Note that self-loops have the same node at both edge ends.Precondition The given node must be either the edge's source node or target node.
Parameters
v:Node |
Node |
| prevInEdge | () | method |
public function prevInEdge():Edge
Returns the predecessor of this edge in the list of incoming edges at its target node.
If this edge is the first incoming edge at its target node, then null is returned.
Precondition This edge must belong to some graph.
ReturnsEdge |
See also
| prevOutEdge | () | method |
public function prevOutEdge():Edge
Returns the predecessor of this edge in the list of outgoing edges at its source node.
If this edge is the first outgoing edge at its source node, then null is returned.
Precondition This edge must belong to some graph.
ReturnsEdge |
See also
| source | () | method |
| target | () | method |
| toString | () | method |
public function toString():StringReturns a String representation of this edge.
ReturnsString |