net.spy.util
Class SPVertex

java.lang.Object
  extended by net.spy.util.SPVertex
All Implemented Interfaces:
java.lang.Comparable

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

A weighted connection to a SPNode.

See Also:
ShortestPathFinder

Field Summary
static int DEFAULT_COST
           
 
Constructor Summary
SPVertex(SPNode to)
          Get an instance of SPVertex linking the two nodes with the default cost.
SPVertex(SPNode to, int cost)
          Get an instance of SPVertex.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare this vertex to another vertex.
 int getCost()
          Get the cost of this vertex.
 SPNode getTo()
          Get the destination node.
 java.lang.String toString()
          String me.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_COST

public static final int DEFAULT_COST
See Also:
Constant Field Values
Constructor Detail

SPVertex

public SPVertex(SPNode to,
                int cost)
Get an instance of SPVertex.

Parameters:
to - the destination node
cost - the cost

SPVertex

public SPVertex(SPNode to)
Get an instance of SPVertex linking the two nodes with the default cost.

Parameters:
to - the destination node
Method Detail

toString

public java.lang.String toString()
String me.

Overrides:
toString in class java.lang.Object

getTo

public SPNode getTo()
Get the destination node.


getCost

public int getCost()
Get the cost of this vertex.


compareTo

public int compareTo(java.lang.Object o)
Compare this vertex to another vertex. Weight will be considered first. If vertices are at the same weight, the destination nodes will be compared.

Specified by:
compareTo in interface java.lang.Comparable


Copyright © 1995-2005 SPY Internetworking. All Rights Reserved.