net.spy.util
Interface SPNode

All Superinterfaces:
java.lang.Comparable
All Known Implementing Classes:
AbstractSPNode

public interface SPNode
extends java.lang.Comparable

A Node for a shortest path graph. This is essentially an object that weighted connections to other objects.

See Also:
ShortestPathFinder

Method Summary
 void addNextHop(SPNode n, SPVertex v)
          Add a vertex to the next hop database to take you to a particular location.
 void clearNextHops()
          Clear out the next hop map.
 boolean equals(java.lang.Object o)
          Object.equals must be overridden to return results consistent to compareTo(other).
 java.util.SortedSet getConnections()
          Get all of the connections to other nodes.
 SPVertex getNextHop(SPNode n)
          Get the next hop to take you to the given node.
 java.util.Map getNextHops()
          Get the mapping of SPNode -> SPVertex hops for this SPNode.
 int hashCode()
          Object.hashCode must be overridden to return a consistent hashCode.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getConnections

java.util.SortedSet getConnections()
Get all of the connections to other nodes.

Returns:
a SortedSet of SPVertex objects.

getNextHops

java.util.Map getNextHops()
Get the mapping of SPNode -> SPVertex hops for this SPNode.

Returns:
an unmodifiable Map representing mapping

clearNextHops

void clearNextHops()
Clear out the next hop map. This should only be called by an ShortestPathFinder.


getNextHop

SPVertex getNextHop(SPNode n)
Get the next hop to take you to the given node.

Parameters:
n - the node you want to get to
Returns:
the vertex describing the next hop, or null if there's no route to the given node

addNextHop

void addNextHop(SPNode n,
                SPVertex v)
Add a vertex to the next hop database to take you to a particular location. This is used just for routing information, not normal links. This should only be called by a ShortestPathFinder.

Parameters:
n - the destination node
v - the vertex that will take you there

hashCode

int hashCode()
Object.hashCode must be overridden to return a consistent hashCode. Objects where one.compareTo(other) == one.equals(other) == true must return the same hashCode.

Overrides:
hashCode in class java.lang.Object

equals

boolean equals(java.lang.Object o)
Object.equals must be overridden to return results consistent to compareTo(other).

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to which to compare
Returns:
true if the objects are equal


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