|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.base.GraphObject | +--y.base.Edge
Represents a directed connection between two nodes in a graph.
Constructor Summary | |
protected |
Edge(Graph g,
Node v,
Edge e1,
Node w,
Edge e2,
int d1,
int d2)
Creates a new edge that belongs to the given graph. |
Method Summary | |
Edge |
createCopy(Graph g,
Node v,
Node w)
Creates a copy of this edge that will be inserted in the given graph connecting the given source and target nodes. |
Graph |
getGraph()
Returns the graph this edge belongs to. |
int |
index()
Returns the index of this edge within its graph G . |
boolean |
isSelfLoop()
Returns true if and only if this edge is a selfloop.
|
Edge |
nextInEdge()
Returns the successor of this edge in the list of ingoing edges at its target node. |
Edge |
nextOutEdge()
Returns the successor of this edge in the list of outgoing edges at its source node. |
protected void |
onReinsert()
Callback method that is invoked from a graph just before this edge will be reinserted into that graph. |
Node |
opposite(Node v)
Returns the node at this edge with is on the opposite side of the given node. |
Edge |
prevInEdge()
Returns the predecessor of this edge in the list of ingoing edges at its target node. |
Edge |
prevOutEdge()
Returns the predecessor of this edge in the list of outgoing edges at its source node. |
Node |
source()
Returns the source node connected to this edge. |
Node |
target()
Returns the target node connected to this edge. |
String |
toString()
Returns a string representation of this edge. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected Edge(Graph g, Node v, Edge e1, Node w, Edge e2, int d1, int d2)
d1 == AFTER (d1 == BEFORE)
and an iteration over the edges at w return e after (before)
e2 if d2 == AFTER (d2 == BEFORE)
.
Precondition: Edge e1 must have source node v and edge e2 must have target node w
v
- the source node of the edgee1
- an edge with source node vw
- the target node of the edgee2
- an edge with target node wd1
- one of the object insertion specifiers BEFORE or AFTERd2
- one of the object insertion specifiers BEFORE or AFTERMethod Detail |
public Edge createCopy(Graph g, Node v, Node w)
g
- the graph the created edge will belong to.v
- the source node of the created edgew
- the target node of the created edge
public Graph getGraph()
null
.
public int index()
>= 0
and
< G.edgeCount()
.
Precondition: This edge must belong to some graph
public Node source()
public Node target()
public Node opposite(Node v)
Precondition: the given node must be either source()
or target()
.
public boolean isSelfLoop()
true
if and only if this edge is a selfloop.
An edge is called a selfloop if it is adjacent to only one node,
i.e. source() == target()
.
public String toString()
toString
in class Object
protected void onReinsert()
public Edge nextOutEdge()
null
will be returned.
Precondition: e is contained in some graph.
public Edge nextInEdge()
null
will be returned.
Precondition: e is contained in some graph.
public Edge prevOutEdge()
null
will be returned.
Precondition: e is contained in some graph.
public Edge prevInEdge()
null
will be returned.
Precondition: e is contained in some graph.
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |