jcommon.graph.impl
Class Edge<TVertex extends IVertex>

java.lang.Object
  extended by jcommon.graph.impl.Edge<TVertex>
Type Parameters:
TVertex - Type of IVertex instances that this edge will connect.
All Implemented Interfaces:
IEdge<TVertex>

public class Edge<TVertex extends IVertex>
extends Object
implements IEdge<TVertex>

See Also:
IEdge

Field Summary
 TVertex from
          The object we are connecting from.
 TVertex to
          The object we are connecting to.
 
Constructor Summary
Edge(TVertex from, TVertex to)
          Create a new directed edge for a graph that defines the relationship between two graph vertices.
 
Method Summary
 boolean equals(Object obj)
           
 TVertex getFrom()
          Retrieves the from instance.
 TVertex getTo()
          Retrieves the to instance.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

from

public final TVertex extends IVertex from
The object we are connecting from.


to

public final TVertex extends IVertex to
The object we are connecting to.

Constructor Detail

Edge

public Edge(TVertex from,
            TVertex to)
Create a new directed edge for a graph that defines the relationship between two graph vertices.

Parameters:
from - The object we are connecting from.
to - The object we are connecting to.
Method Detail

getFrom

public TVertex getFrom()
Retrieves the from instance.

Specified by:
getFrom in interface IEdge<TVertex extends IVertex>
Returns:
The provided from instance.

getTo

public TVertex getTo()
Retrieves the to instance.

Specified by:
getTo in interface IEdge<TVertex extends IVertex>
Returns:
The provided to instance.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(Object)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2012-2013. All Rights Reserved.