ch.bfh.algo.core
Interface GenericGraph<E,V,PE extends GenericPosition<E,PE>,PV extends GenericPosition<V,PV>>

All Superinterfaces:
Collection<V>, Container<V>, GenericContainer<V,PV>, Graph<E,V>, Iterable<V>
All Known Implementing Classes:
DefaultBinaryForest, DefaultForest, DefaultGraph, GenericAdjacencyListGraph, GenericBinaryForestGraph, GenericForestGraph

public interface GenericGraph<E,V,PE extends GenericPosition<E,PE>,PV extends GenericPosition<V,PV>>
extends GenericContainer<V,PV>, Graph<E,V>


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

insertEdge

PE insertEdge(E element)
Description copied from interface: Graph
Creates a new edge containing the 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.

Specified by:
insertEdge in interface Graph<E,V>
Parameters:
element - the element to be used as a label for the new edge.
Returns:
the new edge Position

insertEdge

PE insertEdge(E element,
              PV origin,
              PV destination)

insertVertex

PV insertVertex(V element)
Description copied from interface: Graph
Creates a new vertex containing the element. This vertex is then returned (it is a Position<V>).

Specified by:
insertVertex in interface Graph<E,V>
Parameters:
element - the element to be used as a label for the new vertex.
Returns:
the new vertex Position

origin

PV origin(Position<?> edge)
                                        throws InvalidAccessorException
Description copied from interface: Graph
Returns the origine of the edge edge

Specified by:
origin in interface Graph<E,V>
Parameters:
edge - an edge
Returns:
the origin (a vertex) of the edge.
Throws:
InvalidAccessorException - if the vertex or the edge do not belong to the graph

destination

PV destination(Position<?> edge)
                                             throws InvalidAccessorException
Description copied from interface: Graph
Returns the destination of the edge edge

Specified by:
destination in interface Graph<E,V>
Parameters:
edge - an edge
Returns:
the destination (a vertex) of the edge.
Throws:
InvalidAccessorException - if the vertex or the edge do not belong to the graph

opposite

PV opposite(Position<?> edge,
            Position<?> vertex)
                                          throws InvalidAccessorException
Description copied from interface: Graph
Returns the vertex that is opposite to the vertex 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.

Specified by:
opposite in interface Graph<E,V>
Parameters:
edge - an edge
Throws:
InvalidAccessorException - if the edge does not belong to the graph

vertices

PositionList<V,PV> vertices()
Description copied from interface: Graph
Returns a list of all the vertices contained in the graph.

Specified by:
vertices in interface Graph<E,V>
Returns:
the list of all vertices

edges

PositionList<E,PE> edges()
Description copied from interface: Graph
Returns a list of all the edges contained in the graph.

Specified by:
edges in interface Graph<E,V>
Returns:
the list of all edges

edges

PositionList<E,PE> edges(Direction type)
Description copied from interface: Graph
Returns a list of all the edges of a desired type. type can have the following values:

Specified by:
edges in interface Graph<E,V>
Parameters:
type - the type of the edges
Returns:
the list of all edges

incidentEdges

PositionList<E,PE> incidentEdges(Position<?> vertex,
                                 Direction type)
                                                               throws InvalidAccessorException
Description copied from interface: Graph
Returns a list of the incident edges of the vertex. Depending on the value of type, the result is different.

Specified by:
incidentEdges in interface Graph<E,V>
Parameters:
vertex - the vertex
type - the type of the edges
Returns:
the list of all edges
Throws:
InvalidAccessorException

adjacentVertices

PositionList<V,PV> adjacentVertices(Position<?> vertex,
                                    Direction type)
                                                                  throws InvalidAccessorException
Description copied from interface: Graph
Returns a list of the vertices adjacent to vertex. Depending on the value of type, the result is different.

Specified by:
adjacentVertices in interface Graph<E,V>
Parameters:
vertex - the vertex
type - the type of the edges
Returns:
the list of adjacent vertices
Throws:
InvalidAccessorException