|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.base.GraphObject | +--y.base.Node
Represents a vertex in the directed graph datatype Graph
.
Constructor Summary | |
protected |
Node(Graph g)
Instantiates a new Node object that will be part of the given graph. |
Method Summary | |
Node |
createCopy(Graph g)
Creates a copy of this node that will be inserted in the given graph. |
int |
degree()
Returns the number of ingoing and outgoing edges at this node. |
EdgeCursor |
edges()
Returns an edge cursor for all in- and outgoing edges at this node. |
Edge |
firstInEdge()
Returns the first ingoing edge at this node, or null if it does not exist. |
Edge |
firstOutEdge()
Returns the first outgoing edge at this node, or null if it does not exist. |
Edge |
getEdge(Node opposite)
Returns an edge that connects this node with the given node, if such an edge exists. |
Edge |
getEdgeFrom(Node source)
Returns an edge (source,v) , if such an edge exists.
|
Edge |
getEdgeTo(Node target)
Returns an edge (v,target) , if such an edge exists.
|
Graph |
getGraph()
Returns the graph this node belongs to. |
int |
inDegree()
Returns the number of ingoing edges at this node. |
int |
index()
Returns this node's index within its graph G . |
EdgeCursor |
inEdges()
Returns an edge cursor for all ingoing edges at this node. |
EdgeCursor |
inEdges(Edge startEdge)
Returns an edge cursor for ingoing edges at this node that starts that the given edge. |
Edge |
lastInEdge()
Returns the last ingoing edge at this node, or null if it does not exist. |
Edge |
lastOutEdge()
Returns the last outgoing edge at this node, or null if it does not exist. |
NodeCursor |
neighbors()
Returns a node cursor for all neighbor nodes of this node. |
int |
outDegree()
Returns the number of outgoing edges at this node. |
EdgeCursor |
outEdges()
Returns an edge cursor for all outgoing edges at this node. |
EdgeCursor |
outEdges(Edge startEdge)
Returns an edge cursor for outgoing edges at this node that starts that the given edge. |
NodeCursor |
predecessors()
Returns a node cursor for all predecessor nodes of this node. |
void |
sortInEdges(Comparator c)
Sorts ingoing edges at this node according to c. |
void |
sortOutEdges(Comparator c)
Sorts outgoing edges at this node according to c. |
NodeCursor |
successors()
Returns a node cursor for all successor nodes of this node. |
String |
toString()
Returns a string representation of this node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected Node(Graph g)
g
- the graph the created node will belong to.Method Detail |
public Node createCopy(Graph g)
g
- the graph the created node will belong to.
public int degree()
public int inDegree()
public int outDegree()
public int index()
>= 0
and
< G.nodeCount()
.
Precondition: This edge must belong to some graph
public Graph getGraph()
null
.
public Edge firstOutEdge()
public Edge firstInEdge()
public Edge lastOutEdge()
public Edge lastInEdge()
public EdgeCursor edges()
public EdgeCursor inEdges()
public EdgeCursor inEdges(Edge startEdge)
Node.inEdges()
.
Precondition: startEdge is an ingoing edge at this node
startEdge
- the first edge being accessed by the returned cursor.public EdgeCursor outEdges()
public EdgeCursor outEdges(Edge startEdge)
Node.outEdges()
.
Precondition: startEdge is an outgoing edge at this node
startEdge
- the first edge being accessed by the returned cursor.public NodeCursor neighbors()
public NodeCursor predecessors()
public NodeCursor successors()
public Edge getEdgeTo(Node target)
(v,target)
, if such an edge exists.
Otherwise null
is returned.
public Edge getEdgeFrom(Node source)
(source,v)
, if such an edge exists.
Otherwise null
is returned.
public Edge getEdge(Node opposite)
null
is returned.
public void sortInEdges(Comparator c)
public void sortOutEdges(Comparator c)
public String toString()
toString
in class Object
|
© 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 |