fcmodeler.jsomap
Class Edge

java.lang.Object
  |
  +--fcmodeler.jsomap.Edge
All Implemented Interfaces:
java.lang.Comparable

public class Edge
extends java.lang.Object
implements java.lang.Comparable

A simple implementation of an edge in a graph. An edge consists of two objects: the tail and the head.

Version:
 
Author:
default

Constructor Summary
Edge(java.lang.Object tail, java.lang.Object head)
          Creates a new Edge using the specfied tail and head nodes.
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares the specified object to this edge.
 boolean equals(java.lang.Object obj)
          Returns true if the specified object is an edge and its tail and head nodes are equal to this edge's tail and head nodes.
 java.lang.Object getHead()
          Returns the head node of this edge.
 java.lang.Object getTail()
          Returns the tail node of this edge.
 int hashCode()
          Returns the hash code of this edge.
 java.lang.String toString()
          Returns the string representation of this edge.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Edge

public Edge(java.lang.Object tail,
            java.lang.Object head)
Creates a new Edge using the specfied tail and head nodes.
Parameters:
tail - the tail node.
head - the head node.
Method Detail

compareTo

public int compareTo(java.lang.Object obj)
Compares the specified object to this edge. The object must be an edge. Compares the tail nodes, and if the tail nodes are equal compares the head nodes.
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the object to compare to this edge.
Returns:
the result of the comparison.

equals

public boolean equals(java.lang.Object obj)
Returns true if the specified object is an edge and its tail and head nodes are equal to this edge's tail and head nodes.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to test for equality with this edge.
Returns:
true if the specified object is equal to this edge.

getHead

public java.lang.Object getHead()
Returns the head node of this edge.
Returns:
the head node of this edge.

getTail

public java.lang.Object getTail()
Returns the tail node of this edge.
Returns:
the tail node of this edge.

hashCode

public int hashCode()
Returns the hash code of this edge.
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of this edge.

toString

public java.lang.String toString()
Returns the string representation of this edge.
Overrides:
toString in class java.lang.Object
Returns:
the string representation of this edge.