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