nick.graph
Class EdgeDouble<E extends java.lang.Double>

java.lang.Object
  extended by nick.graph.GraphElement<E>
      extended by nick.graph.Edge<E>
          extended by nick.graph.EdgeDouble<E>
All Implemented Interfaces:
java.lang.Comparable<EdgeDouble<E>>

public class EdgeDouble<E extends java.lang.Double>
extends Edge<E>
implements java.lang.Comparable<EdgeDouble<E>>

This class is implemented by a class that should extend the Edge class. A comparable edge should be numerical for procedures like Kruskal's, Prim's or Dijkstra's algorithms. Other implementations may be allowed for other classes that have natural ordering.

The generic parameter E is forced to be of type Double.

Version:
March 15, 2009
Author:
Nick Aschenbach

Constructor Summary
EdgeDouble(E the_data)
          Construct a new EdgeDouble object.
EdgeDouble(E the_data, java.lang.String the_name)
          Construct a new EdgeDouble object.
 
Method Summary
 int compareTo(EdgeDouble<E> the_other_edge)
           
 boolean equals(java.lang.Object other)
           
 int hashCode()
           
 
Methods inherited from class nick.graph.GraphElement
data, name, setData, setName, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EdgeDouble

public EdgeDouble(E the_data)
Construct a new EdgeDouble object.

Parameters:
the_data - The value of this vertex.

EdgeDouble

public EdgeDouble(E the_data,
                  java.lang.String the_name)
Construct a new EdgeDouble object.

Parameters:
the_data - The value of this vertex.
the_name - The name of this vertex.
Method Detail

compareTo

public int compareTo(EdgeDouble<E> the_other_edge)
Specified by:
compareTo in interface java.lang.Comparable<EdgeDouble<E extends java.lang.Double>>

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object