salvo.jesus.graph
Class DirectedEdgeWeakImpl

java.lang.Object
  extended by salvo.jesus.graph.DirectedEdgeWeakImpl
All Implemented Interfaces:
java.io.Serializable, DirectedEdge, Edge

 class DirectedEdgeWeakImpl
extends java.lang.Object
implements DirectedEdge

A weak implementation a directed edge in a graph. This is only used internally to implement the direction of an edge without having an actual edge.

Author:
Jesus M. Salvo Jr.

Field Summary
(package private)  int direction
          The direction of the edge.
private  Vertex sinkVertex
          The sink Vertex of the Edge
private  Vertex sourceVertex
          The source Vertex of the Edge
 
Fields inherited from interface salvo.jesus.graph.DirectedEdge
DIRECTION_A_TO_B, DIRECTION_B_TO_A, NODIRECTION
 
Constructor Summary
DirectedEdgeWeakImpl(Vertex sourceVertex, Vertex sinkVertex)
          Creates an DirectedEdgeWeakImpl object whose origin and destination vertices are specified by the method parameters.
 
Method Summary
 int getDirection()
          Returns the direction of the Edge
 java.lang.Object getObject()
          Empty method implemetation that returns null.
 Vertex getOppositeVertex(Vertex vertex)
          Empty method implemetation that returns null.
 Vertex getSink()
          Returns the sink Vertex of the edge.
 Vertex getSource()
          Returns the source Vertex of the edge.
 Vertex getVertexA()
          Empty method implemetation that returns null.
 Vertex getVertexB()
          Empty method implemetation that returns null.
 void setObject(java.lang.Object obj)
          Empty method implemetation does noething.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface salvo.jesus.graph.Edge
toString
 

Field Detail

sourceVertex

private Vertex sourceVertex
The source Vertex of the Edge


sinkVertex

private Vertex sinkVertex
The sink Vertex of the Edge


direction

int direction
The direction of the edge.

Constructor Detail

DirectedEdgeWeakImpl

public DirectedEdgeWeakImpl(Vertex sourceVertex,
                            Vertex sinkVertex)
Creates an DirectedEdgeWeakImpl object whose origin and destination vertices are specified by the method parameters.

See Also:
Vertex
Method Detail

getSource

public Vertex getSource()
Returns the source Vertex of the edge.

Specified by:
getSource in interface DirectedEdge
Returns:
The source Vertex.

getSink

public Vertex getSink()
Returns the sink Vertex of the edge.

Specified by:
getSink in interface DirectedEdge
Returns:
The sink Vertex.

getDirection

public int getDirection()
Returns the direction of the Edge

Specified by:
getDirection in interface DirectedEdge

getVertexA

public Vertex getVertexA()
Empty method implemetation that returns null. This method should never be called or delegated to for whatever reason.

Specified by:
getVertexA in interface Edge
Returns:
Vertex Endpoint A of the edge.

getVertexB

public Vertex getVertexB()
Empty method implemetation that returns null. This method should never be called or delegated to for whatever reason.

Specified by:
getVertexB in interface Edge
Returns:
Vertex Endpoint B of the edge.

setObject

public void setObject(java.lang.Object obj)
Empty method implemetation does noething. This method should never be called or delegated to for whatever reason.

Specified by:
setObject in interface Edge

getObject

public java.lang.Object getObject()
Empty method implemetation that returns null. This method should never be called or delegated to for whatever reason.

Specified by:
getObject in interface Edge

getOppositeVertex

public Vertex getOppositeVertex(Vertex vertex)
Empty method implemetation that returns null. This method should never be called or delegated to for whatever reason.

Specified by:
getOppositeVertex in interface 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.