salvo.jesus.graph
Class DirectedEdgeImpl

java.lang.Object
  extended by salvo.jesus.graph.EdgeImpl
      extended by salvo.jesus.graph.DirectedEdgeImpl
All Implemented Interfaces:
java.io.Serializable, DirectedEdge, Edge
Direct Known Subclasses:
NamedEdge

public class DirectedEdgeImpl
extends EdgeImpl
implements DirectedEdge

Represents a directed edge in a graph.

Author:
Jesus M. Salvo Jr.
See Also:
Serialized Form

Field Summary
(package private)  DirectedEdgeWeakImpl directionOfEdge
          The direction of the edge.
 
Fields inherited from class salvo.jesus.graph.EdgeImpl
object, vertexA, vertexB
 
Fields inherited from interface salvo.jesus.graph.DirectedEdge
DIRECTION_A_TO_B, DIRECTION_B_TO_A, NODIRECTION
 
Constructor Summary
DirectedEdgeImpl(Vertex sourceVertex, Vertex sinkVertex)
          Creates an DirectedEdgeImpl object whose origin and destination vertices are specified by the method parameters.
 
Method Summary
protected  java.lang.Object clone()
          Creates a clone of this Edge.
 int getDirection()
          Returns the direction of the Edge
 Vertex getSink()
          Returns the sink Vertex of the edge.
 Vertex getSource()
          Returns the source Vertex of the edge.
 java.lang.String toString()
          Returns a String representation of the Edge, using the the toString() methods of Vertex.
 
Methods inherited from class salvo.jesus.graph.EdgeImpl
getObject, getOppositeVertex, getVertexA, getVertexB, setObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface salvo.jesus.graph.Edge
getObject, getOppositeVertex, getVertexA, getVertexB, setObject
 

Field Detail

directionOfEdge

DirectedEdgeWeakImpl directionOfEdge
The direction of the edge. The implementation of the DirectedEdge interface is delegated to this object.

Constructor Detail

DirectedEdgeImpl

public DirectedEdgeImpl(Vertex sourceVertex,
                        Vertex sinkVertex)
Creates an DirectedEdgeImpl 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

toString

public java.lang.String toString()
Returns a String representation of the Edge, using the the toString() methods of Vertex.

Specified by:
toString in interface Edge
Overrides:
toString in class EdgeImpl
Returns:
The String representation of the Edge
See Also:
Vertex

clone

protected java.lang.Object clone()
Creates a clone of this Edge. This calls the Edge constructor, thereby creating a new instance of Edge. However, the vertices in both endpoints of the Edge are not cloned.

Overrides:
clone in class EdgeImpl
Returns:
A clone of an instance of Edge.