net.spy.util
Interface SPNode<T extends SPNode<T>>

All Superinterfaces:
Comparable<T>
All Known Implementing Classes:
AbstractSPNode

public interface SPNode<T extends SPNode<T>>
extends Comparable<T>

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<T> n, SPVertex<T> 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(Object o)
          Object.equals must be overridden to return results consistent to compareTo(other).
 SortedSet<SPVertex<T>> getConnections()
          Get all of the connections to other nodes.
 SPVertex<T> getNextHop(SPNode<T> n)
          Get the next hop to take you to the given node.
 Map<SPNode<T>,SPVertex<T>> 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

SortedSet<SPVertex<T>> getConnections()
Get all of the connections to other nodes.

Returns:
a SortedSet of SPVertex objects.

getNextHops

Map<SPNode<T>,SPVertex<T>> 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<T> getNextHop(SPNode<T> 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<T> n,
                SPVertex<T> 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 Object

equals

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

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


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