jdsl.map.api
Interface InspectableEmbeddedPlanarGraph

All Superinterfaces:
InspectableContainer, InspectableGraph, InspectablePositionalContainer
All Known Subinterfaces:
EmbeddedPlanarGraph

public interface InspectableEmbeddedPlanarGraph
extends InspectableGraph

An interface describing the accessor methods of an embedded planar graph. In an embedded planar graph the ordering of the edges incident with a vertex is given by a planar embedding of the graph. The graph must be connected. Directed and undirected edges may coexist. Multiple edges and self-loops are allowed. A position and its dual position may store different elements (the actual behavior is implementation-dependent). If an edge is directed, its dual edge need not be (the actual behavior is implementation-dependent).

Version:
$Id: InspectableEmbeddedPlanarGraph.java,v 1.11 2001/10/18 15:39:04 lv Exp $
Author:
Luca Vismara (lv)

Method Summary
 Face aCommonFace(Edge e1, Edge e2)
           
 Face aCommonFace(Vertex v1, Vertex v2)
           
 FaceIterator adjacentFaces(Face f)
           
 Face aFace()
           
 Edge anIncidentEdge(Face f)
           
 Face anIncidentFace(Vertex v)
           
 Vertex anIncidentVertex(Face f)
           
 boolean areAdjacent(Edge e1, Edge e2)
          Checks whether two edges have at least one common endpoint.
 boolean areAdjacent(Face f1, Face f2)
           
 boolean areIncident(Edge e, Face f)
           
 boolean areIncident(Vertex v, Face f)
           
 EdgeIterator connectingEdges(Face f1, Face f2)
           
 int degree(Face f)
           
 Edge dual(Edge e)
           
 Vertex dual(Face f)
           
 Face dual(Vertex v)
           
 FaceIterator faces()
           
 Edge incidentEdge(Face f, Order order, Edge e, Vertex v)
           
 Edge incidentEdge(Vertex v, Order order, Edge e, Face f)
           
 EdgeIterator incidentEdges(Face f)
           
 Face incidentFace(Vertex v, Order order, Edge e)
           
 Face[] incidentFaces(Edge e)
           
 FaceIterator incidentFaces(Vertex v)
           
 Vertex incidentVertex(Face f, Order order, Edge e)
           
 VertexIterator incidentVertices(Face f)
           
 InspectableEmbeddedPlanarGraph inspectableDual()
           
 Face leftFace(Edge e)
           
 int numFaces()
           
 Face opposite(Face f, Edge e)
           
 Face rightFace(Edge e)
           
 
Methods inherited from interface jdsl.graph.api.InspectableGraph
aCommonVertex, aConnectingEdge, adjacentVertices, adjacentVertices, anEdge, anIncidentEdge, anIncidentEdge, areAdjacent, areIncident, aVertex, connectingEdges, degree, degree, destination, directedEdges, edges, endVertices, incidentEdges, incidentEdges, isDirected, numEdges, numVertices, opposite, origin, undirectedEdges, vertices
 
Methods inherited from interface jdsl.core.api.InspectablePositionalContainer
positions
 
Methods inherited from interface jdsl.core.api.InspectableContainer
contains, elements, isEmpty, size
 

Method Detail

numFaces

public int numFaces()
Returns:
the number of faces

faces

public FaceIterator faces()
Returns:
an iterator over the faces in the graph

aFace

public Face aFace()
Returns:
an arbitrary face

areAdjacent

public boolean areAdjacent(Edge e1,
                           Edge e2)
                    throws InvalidAccessorException
Description copied from interface: InspectableGraph
Checks whether two edges have at least one common endpoint. (For example, parallel edges are considered adjacent, as are two self-loops incident on a single vertex.)
Specified by:
areAdjacent in interface InspectableGraph
Parameters:
e1 - an edge
e2 - an edge
Returns:
whether e1 and e2 are adjacent, i.e., whether they have at least one common endvertex or one common incident face
Throws:
InvalidAccessorException - if either e1 or e2 is null or not contained in this graph

areAdjacent

public boolean areAdjacent(Face f1,
                           Face f2)
                    throws InvalidAccessorException
Parameters:
f1 - a face
f2 - a face
Returns:
whether f1 and f2 are adjacent, i.e., whether they have at least one edge in common
Throws:
InvalidAccessorException - if either f1 or f2 is null or not contained in this graph

areIncident

public boolean areIncident(Vertex v,
                           Face f)
                    throws InvalidAccessorException
Parameters:
v - a vertex
f - a face
Returns:
whether v and f are incident
Throws:
InvalidAccessorException - if either v or f is null or not contained in this graph

areIncident

public boolean areIncident(Edge e,
                           Face f)
                    throws InvalidAccessorException
Parameters:
e - an edge
f - a face
Returns:
whether e and f are incident
Throws:
InvalidAccessorException - if either e or f is null or not contained in this graph

incidentFaces

public FaceIterator incidentFaces(Vertex v)
                           throws InvalidAccessorException
Parameters:
v - a vertex
Returns:
an iterator over the faces incident with v
Throws:
InvalidAccessorException - if v is null or not contained in this graph

anIncidentFace

public Face anIncidentFace(Vertex v)
                    throws InvalidAccessorException
Parameters:
v - a vertex
Returns:
an arbitrary face incident with v
Throws:
InvalidAccessorException - if v is null or not contained in this graph

aCommonFace

public Face aCommonFace(Vertex v1,
                        Vertex v2)
                 throws InvalidAccessorException
Parameters:
v1 - a vertex
v2 - a vertex
Returns:
any face that is incident with both v1 and v2, or Face.NONE if there is no such face
Throws:
InvalidAccessorException - if v1 or v2 is null or not contained in this graph

incidentFaces

public Face[] incidentFaces(Edge e)
                     throws InvalidAccessorException
Parameters:
e - an edge
Returns:
an array (of size 2) containing the two faces incident with e
Throws:
InvalidAccessorException - if e is null or not contained in this graph

opposite

public Face opposite(Face f,
                     Edge e)
              throws InvalidAccessorException,
                     InvalidFaceException
Parameters:
f - one of the two faces incident with e
e - an edge
Returns:
the face incident with e different from f
Throws:
InvalidAccessorException - if either f or e is null or not contained in this graph
InvalidFaceException - if f is not a face incident with e

aCommonFace

public Face aCommonFace(Edge e1,
                        Edge e2)
                 throws InvalidAccessorException
Parameters:
e1 - an edge
e2 - an edge
Returns:
any face that is incident with both e1 and e2, or Face.NONE if there is no such face
Throws:
InvalidAccessorException - if e1 or e2 is null or not contained in this graph

degree

public int degree(Face f)
           throws InvalidAccessorException
Parameters:
f - a face
Returns:
the number of edges incident with f
Throws:
InvalidAccessorException - if f is null or not contained in this graph

adjacentFaces

public FaceIterator adjacentFaces(Face f)
                           throws InvalidAccessorException
Parameters:
f - a face
Returns:
an iterator over the faces adjacent to f
Throws:
InvalidAccessorException - if f is null or not contained in this graph

incidentVertices

public VertexIterator incidentVertices(Face f)
                                throws InvalidAccessorException
Parameters:
f - a face
Returns:
an iterator over the vertices incident with f
Throws:
InvalidAccessorException - if f is null or not contained in this graph

anIncidentVertex

public Vertex anIncidentVertex(Face f)
                        throws InvalidAccessorException
Parameters:
f - a face
Returns:
an arbitrary vertex incident with f
Throws:
InvalidAccessorException - if f is null or not contained in this graph

incidentEdges

public EdgeIterator incidentEdges(Face f)
                           throws InvalidAccessorException
Parameters:
f - a face
Returns:
an iterator over the edges incident with f
Throws:
InvalidAccessorException - if f is null or not contained in this graph

anIncidentEdge

public Edge anIncidentEdge(Face f)
                    throws InvalidAccessorException
Parameters:
f - a face
Returns:
an arbitrary edge incident with f or Edge.NONE if there is no such edge
Throws:
InvalidAccessorException - if f is null or not contained in this graph

connectingEdges

public EdgeIterator connectingEdges(Face f1,
                                    Face f2)
                             throws InvalidAccessorException
Parameters:
f1 - a face
f2 - a face
Returns:
an iterator over the edges in common between f1 and f2
Throws:
InvalidAccessorException - if either f1 or f2 is null or not contained in this graph

inspectableDual

public InspectableEmbeddedPlanarGraph inspectableDual()
Returns:
the dual inspectable embedded planar graph

dual

public Face dual(Vertex v)
          throws InvalidAccessorException
Parameters:
v - a vertex
Returns:
the dual face of v
Throws:
InvalidAccessorException - if v is null or not contained in this graph

dual

public Edge dual(Edge e)
          throws InvalidAccessorException
Parameters:
e - an edge
Returns:
the dual edge of e
Throws:
InvalidAccessorException - if e is null or not contained in this graph

dual

public Vertex dual(Face f)
            throws InvalidAccessorException
Parameters:
f - a face
Returns:
the dual vertex of f
Throws:
InvalidAccessorException - if f is null or not contained in this graph

leftFace

public Face leftFace(Edge e)
              throws InvalidAccessorException,
                     InvalidEdgeException
Parameters:
e - a directed edge
Returns:
the face to the left of e
Throws:
InvalidAccessorException - if e is null or not contained in this graph
InvalidEdgeException - if e is not directed

rightFace

public Face rightFace(Edge e)
               throws InvalidAccessorException,
                      InvalidEdgeException
Parameters:
e - a directed edge
Returns:
the face to the right of e
Throws:
InvalidAccessorException - if e is null or not contained in this graph
InvalidEdgeException - if e is not directed

incidentEdge

public Edge incidentEdge(Vertex v,
                         Order order,
                         Edge e,
                         Face f)
                  throws InvalidAccessorException,
                         InvalidOrderException,
                         InvalidEdgeException,
                         InvalidFaceException
Parameters:
v - a vertex
order - indicates if the edge to return is the one Order.AFTER_CW or Order.AFTER_CCW e around v
e - an edge incident with v
f - a face incident with e; this parameter is meaningful only if e is a self-loop, otherwise null can be passed
Returns:
the edge incident with v (and f, if e is a self-loop) that comes order e
Throws:
InvalidAccessorException - if v, or e, or f is null or not contained in this graph
InvalidOrderException - if order is different from Order.AFTER_CW or Order.AFTER_CCW
InvalidEdgeException - if e is not an edge incident with v
InvalidFaceException - if f is not a face incident with e

incidentEdge

public Edge incidentEdge(Face f,
                         Order order,
                         Edge e,
                         Vertex v)
                  throws InvalidAccessorException,
                         InvalidOrderException,
                         InvalidEdgeException,
                         InvalidVertexException
Parameters:
f - a face
order - indicates if the edge to return is the one Order.AFTER_LHS or Order.AFTER_RHS e around f
e - an edge incident with f
v - an endvertex of e; this parameter is meaningful only if e is a bridge, otherwise null can be passed
Returns:
the edge incident with f (and v, if e is a bridge) that comes order e
Throws:
InvalidAccessorException - if f, or e, or v is null or not contained in this graph
InvalidOrderException - if order is different from Order.AFTER_LHS or Order.AFTER_RHS
InvalidEdgeException - if e is not an edge incident with f
InvalidVertexException - if v is not an endvertex of e

incidentFace

public Face incidentFace(Vertex v,
                         Order order,
                         Edge e)
                  throws InvalidAccessorException,
                         InvalidOrderException,
                         InvalidEdgeException,
                         NoUniqueResultException
Parameters:
v - a vertex
order - indicates if the face to return is the one Order.AFTER_CW or Order.AFTER_CCW e around v
e - an edge incident with v
Returns:
the face incident with v that comes order e
Throws:
InvalidAccessorException - if v, or e is null or not contained in this graph
InvalidOrderException - if order is different from Order.AFTER_CW or Order.AFTER_CCW
InvalidEdgeException - if e is not an edge incident with v
NoUniqueResultException - if e is a self-loop

incidentVertex

public Vertex incidentVertex(Face f,
                             Order order,
                             Edge e)
                      throws InvalidAccessorException,
                             InvalidOrderException,
                             InvalidEdgeException,
                             InvalidVertexException
Parameters:
f - a face
order - indicates if the vertex to return is the one Order.AFTER_LHS or Order.AFTER_RHS e around f
e - an edge incident with f
Returns:
the vertex incident with f that comes order e
Throws:
InvalidAccessorException - if f, or e is null or not contained in this graph
InvalidOrderException - if order is different from Order.AFTER_LHS or Order.AFTER_RHS
InvalidEdgeException - if e is not an edge incident with f
NoUniqueResultException - if e is a bridge