|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GenericGraph<E,V,PE extends GenericPosition<E,PE>,PV extends GenericPosition<V,PV>>
Method Summary | |
---|---|
PositionList<V,PV> |
adjacentVertices(Position<?> vertex,
Direction type)
Returns a list of the vertices adjacent to vertex . |
PV |
destination(Position<?> edge)
Returns the destination of the edge edge |
PositionList<E,PE> |
edges()
Returns a list of all the edges contained in the graph. |
PositionList<E,PE> |
edges(Direction type)
Returns a list of all the edges of a desired type. |
PositionList<E,PE> |
incidentEdges(Position<?> vertex,
Direction type)
Returns a list of the incident edges of the vertex . |
PE |
insertEdge(E element)
Creates a new edge containing the element . |
PE |
insertEdge(E element,
PV origin,
PV destination)
|
PV |
insertVertex(V element)
Creates a new vertex containing the element . |
PV |
opposite(Position<?> edge,
Position<?> vertex)
Returns the vertex that is opposite to the vertex vertex on the edge edge . |
PV |
origin(Position<?> edge)
Returns the origine of the edge edge |
PositionList<V,PV> |
vertices()
Returns a list of all the vertices contained in the graph. |
Methods inherited from interface ch.bfh.algo.core.GenericContainer |
---|
insert, positionIterator |
Methods inherited from interface ch.bfh.algo.Container |
---|
delete, element, encloses, replace, swap |
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods inherited from interface ch.bfh.algo.Graph |
---|
deleteEdge, deleteVertex, detach, edgeElement, edgeElements, insertEdge, isDirected, replaceEdge, replaceVertex, reverse, setDestination, setDirected, setOrigin, setUndirected, swapEdge, swapVertex, vertexElement, vertexElements |
Methods inherited from interface ch.bfh.algo.Container |
---|
delete, element, encloses, replace, swap |
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
---|
PE insertEdge(E element)
Graph
element
. This
edge is then returned (it is a Position<E>
).
The edge does not have any extremities (adjacent
vertices). They have to be defined afterward.
insertEdge
in interface Graph<E,V>
element
- the element to be used as a label for the new edge.
Position
PE insertEdge(E element, PV origin, PV destination)
PV insertVertex(V element)
Graph
element
. This
vertex is then returned (it is a
Position<V>
).
insertVertex
in interface Graph<E,V>
element
- the element to be used as a label for the new vertex.
Position
PV origin(Position<?> edge) throws InvalidAccessorException
Graph
edge
origin
in interface Graph<E,V>
edge
- an edge
InvalidAccessorException
- if the vertex or the edge do not belong to the graphPV destination(Position<?> edge) throws InvalidAccessorException
Graph
edge
destination
in interface Graph<E,V>
edge
- an edge
InvalidAccessorException
- if the vertex or the edge do not belong to the graphPV opposite(Position<?> edge, Position<?> vertex) throws InvalidAccessorException
Graph
vertex
on the edge edge
. It
vertex
is the origin of edge
, then it
returns its destination, and it returns its origin if
vertex
is the destination of edge
.
opposite
in interface Graph<E,V>
edge
- an edge
InvalidAccessorException
- if the edge does not belong to
the graphPositionList<V,PV> vertices()
Graph
vertices
in interface Graph<E,V>
PositionList<E,PE> edges()
Graph
edges
in interface Graph<E,V>
PositionList<E,PE> edges(Direction type)
Graph
type
can have the following values:
Direction.DIRECTED
Direction.UNDIRECTED
Direction.ALL
edges
in interface Graph<E,V>
type
- the type of the edges
PositionList<E,PE> incidentEdges(Position<?> vertex, Direction type) throws InvalidAccessorException
Graph
vertex
. Depending on the value of
type
, the result is different.
type==Direction.IN
the method returns
the in incident edgestype==Direction.OUT
the method returns the
out incident edgestype==Direction.ALL
then the method
returns all the incident edges (including the undirected
ones).
incidentEdges
in interface Graph<E,V>
vertex
- the vertextype
- the type of the edges
InvalidAccessorException
PositionList<V,PV> adjacentVertices(Position<?> vertex, Direction type) throws InvalidAccessorException
Graph
vertex
. Depending on the value of
type
, the result is different.
type==Direction.IN
the method returns
the vertices linked to vertex
through an in incident edgetype==Direction.OUT
the method returns the
vertices linked to vertex
through an out incident edgestype==Direction.ALL
then the method
returns all the adjacent vertices.
adjacentVertices
in interface Graph<E,V>
vertex
- the vertextype
- the type of the edges
InvalidAccessorException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |