|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.SpyObject
net.spy.util.AbstractSPNode<T>
public abstract class AbstractSPNode<T extends SPNode<T>>
Abstract implementation of SPNode to make implementation a bit easier.
| Constructor Summary | |
|---|---|
protected |
AbstractSPNode()
Get an instance of AbstractSPNode. |
protected |
AbstractSPNode(SortedSet<SPVertex<T>> l)
Get an instance of AbstractSPNode holding its links in the given Set. |
| 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. |
abstract int |
hashCode()
Must override hashCode along with compareTo(); |
protected void |
linkTo(T n)
Link this SPNode to the given SPNode at the default cost. |
protected void |
linkTo(T n,
int cost)
Link this SPNode to the given SPNode at the given cost. |
| Methods inherited from class net.spy.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Constructor Detail |
|---|
protected AbstractSPNode(SortedSet<SPVertex<T>> l)
l - the links.protected AbstractSPNode()
| Method Detail |
|---|
protected void linkTo(T n,
int cost)
n - SPNode to which to linkcost - cost of this linkprotected void linkTo(T n)
n - the node to which to linkpublic SortedSet<SPVertex<T>> getConnections()
SPNode
getConnections in interface SPNode<T extends SPNode<T>>SPVertex objects.SPNodepublic Map<SPNode<T>,SPVertex<T>> getNextHops()
SPNode
getNextHops in interface SPNode<T extends SPNode<T>>SPNodepublic void clearNextHops()
SPNodeShortestPathFinder.
clearNextHops in interface SPNode<T extends SPNode<T>>SPNodepublic SPVertex<T> getNextHop(SPNode<T> n)
SPNode
getNextHop in interface SPNode<T extends SPNode<T>>n - the node you want to get to
SPNode
public void addNextHop(SPNode<T> n,
SPVertex<T> v)
SPNodeShortestPathFinder.
addNextHop in interface SPNode<T extends SPNode<T>>n - the destination nodev - the vertex that will take you thereSPNodepublic boolean equals(Object o)
SPNode
equals in interface SPNode<T extends SPNode<T>>equals in class Objecto - the object to which to compare
Objectpublic abstract int hashCode()
hashCode in interface SPNode<T extends SPNode<T>>hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||