|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Cycle
Class representing relevant cycles, which are by definition
composed of two cyclic canonical shortest Path
s (for even
cycles) or two cyclic canonical shortest Path
s and an edge
(for odd cycles). We call a path cyclic canonical if it
starts with the node with lowest label.
NodeIterator
,
Path
Constructor Summary | |
Cycle(Path ry,
Path rz)
Constructs an odd relevant cycle made of a shortest path from r->y ( ry ), a shortest path from r->z
(rz ) and the edge (y,z). |
|
Cycle(Path rp,
Path rq,
int y)
Constructs an even cycle made of a shortest path from r->p ( rp ), a shortest path from r->q (rq )
and the edges (p,y ) and (q,y ). |
Method Summary | |
NodeIterator |
first()
Returns an NodeIterator over the nodes of this path
following the edges of this path starting at the first node (by
a call to the next() method). |
NodeIterator |
last()
Returns an NodeIterator over the nodes of this cycle
following the edges of this path ending at the node with lowest
label (by a call to the previous() method). |
int |
length()
Returns the length of this cycle (nr of edges). |
int |
nodeAt(int index)
Returns the node with index index if the cycle
was iterated by a NodeIterator . |
NodeIterator |
nodeIterator(int node)
Returns an NodeIterator over the nodes of this cycle
following the edges of this cycle starting at the specified node
(by a call to the next() method). |
java.lang.String |
toString()
A String representation of this cycle. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Cycle(Path ry, Path rz)
ry
), a shortest path from r->z
(rz
) and the edge (y,z).
ry
- a cyclic canonical shortest path from r to yrz
- a cyclic canonical shortest path from r to zPath
public Cycle(Path rp, Path rq, int y)
rp
), a shortest path from r->q (rq
)
and the edges (p,y
) and (q,y
).
rp
- a cyclic canonical shortest path from r to prq
- a cyclic canonical shortest path from r to qy
- a node connected with p and qPath
Method Detail |
public int length()
public int nodeAt(int index)
index
if the cycle
was iterated by a NodeIterator
.
index
- the index of the node to be returned
public NodeIterator first()
NodeIterator
over the nodes of this path
following the edges of this path starting at the first node (by
a call to the next() method).
NodeIterator
pointing to the first nodeNodeIterator
public NodeIterator last()
NodeIterator
over the nodes of this cycle
following the edges of this path ending at the node with lowest
label (by a call to the previous() method).
NodeIterator
pointing to the last nodeNodeIterator
public NodeIterator nodeIterator(int node)
NodeIterator
over the nodes of this cycle
following the edges of this cycle starting at the specified node
(by a call to the next() method).
NodeIterator
pointing to the last nodeNodeIterator
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |