|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Path<V,E extends Link<V>>
A path in a Graph
is a sequence of vertices such
that from each of its vertices there is an Link
to
the successor vertex. There is two specific vertices called end or terminal
vertices of the path. The other vertices in the path are internal vertices.
This interface make some restrictions on the representing path :
Method Summary | |
---|---|
void |
concat(E e)
Concat the edge e to this path. |
void |
concat(Path<V,E> p)
Concat the path p to this path. |
boolean |
contains(E e)
Tell if this path contain the edge e. |
boolean |
contains(V v)
Tell if this path contain the vertex o. |
java.util.Iterator<E> |
edgeIterator(V v)
Give an iterator on the Link of the path. |
E[] |
getEdges(V v)
Give the Link connected to one vertex. |
V[] |
getEnds()
Give the ends of the path. |
V |
getFirstVertex()
Return the first vertex of an oriented Path. |
V |
getLastVertex()
Return the last vertex of an oriented Path. |
boolean |
isDirected()
Say if this path is oriented. |
boolean |
isEnd(V v)
Determine if a vertex is an end of this path. |
int |
length()
Give the length (number of edges) of this path. |
void |
remove(E e)
Remove one Link from this Path . |
void |
remove(V v)
Remove one vertex from a this path. |
java.util.Iterator<V> |
vertexIterator(V v)
Give an iterator on the vertex of the path. |
Method Detail |
---|
V[] getEnds()
E[] getEdges(V v)
Link
connected to one vertex.
v
- A vertex
java.lang.IllegalArgumentException
void concat(Path<V,E> p) throws java.lang.RuntimeException
p
- The path that we concat to this path.
java.lang.RuntimeException
- if the two paths don't share one of their ends.void concat(E e) throws java.lang.RuntimeException
e
- The edge that we concat to this path.
java.lang.RuntimeException
- if the this path and the given edge don't share one of their ends
or if e is a loop.void remove(V v) throws java.lang.RuntimeException
v
- The vertex to suppress.
java.lang.RuntimeException
- If the givem vertex is not one ends of this path.void remove(E e) throws java.lang.RuntimeException
Link
from this Path
. Note that the Link
must be an ending Link
, in other word the Link
must
contains one of the ends of this Path
.
e
- The edge to suppress.
java.lang.RuntimeException
- If the given edge is not an ending edge of this path.boolean contains(V v)
v
- The vertex.
true
if this path contains o and false
otherwise.boolean contains(E e)
e
- The edge.
true
if this path contains e and false
otherwise.int length()
boolean isEnd(V v)
v
- a vertex.
true
if v is one of the ends of this
Path
.java.util.Iterator<E> edgeIterator(V v) throws java.lang.RuntimeException
Link
of the path. The first edge return
contains o.
v
- One of the ends of this Path
if is not directed and any
vertices belonging this Path
otherwise.
java.lang.RuntimeException
- if this opath is undirected and the given vertex is not one end
of this path.java.util.Iterator<V> vertexIterator(V v) throws java.lang.RuntimeException
v
- One of the ends of this Path
if is not oriented and any
vertices belonging this Path
otherwise.
Path
.
java.lang.RuntimeException
- if this opath is undirected and the given vertex is not one end
of this path.boolean isDirected()
true<\code> if the path is directed and false<\code> otherwise.
V getFirstVertex()
java.lang.UnsupportedOperationException
- if this path is undirected.V getLastVertex()
java.lang.UnsupportedOperationException
- if this path is undirected.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |