salvo.jesus.graph
Interface Edge

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
DirectedEdge
All Known Implementing Classes:
DirectedEdgeImpl, DirectedEdgeWeakImpl, EdgeImpl, NamedEdge

public interface Edge
extends java.io.Serializable

An interface for edges in a Graph.

Author:
Jesus M. Salvo Jr.

Method Summary
 java.lang.Object getObject()
          Returns the object encapsulated by the Edge
 Vertex getOppositeVertex(Vertex v)
          Returns the Vertex opposite to the specified Vertex in the edge.
 Vertex getVertexA()
          Returns the endpoint A of the edge.
 Vertex getVertexB()
          Returns the endpoint B of the edge.
 void setObject(java.lang.Object obj)
          Sets an Object that is encapsulated by the Edge
 java.lang.String toString()
          Returns the String representation of the edge.
 

Method Detail

getVertexA

Vertex getVertexA()
Returns the endpoint A of the edge.

Returns:
Vertex Endpoint A of the edge.

getVertexB

Vertex getVertexB()
Returns the endpoint B of the edge.

Returns:
Vertex Endpoint B of the edge.

getOppositeVertex

Vertex getOppositeVertex(Vertex v)
Returns the Vertex opposite to the specified Vertex in the edge.

Returns:
Vertex The Vertex object that is the opposite to the specifid Vertex. If the specified Vertex is not an endpoint of the edge, returns null.

setObject

void setObject(java.lang.Object obj)
Sets an Object that is encapsulated by the Edge


getObject

java.lang.Object getObject()
Returns the object encapsulated by the Edge


toString

java.lang.String toString()
Returns the String representation of the edge.

Overrides:
toString in class java.lang.Object