|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Link
A Link represents a direct connection from one Router to another.
Field Summary | |
static int |
INFINITY
Link.INFINITY is the cost to an unreachable or unknown Router. |
Constructor Summary | |
Link(Router sndr,
Router rcvr,
int cst)
new Link(sndr, rcvr, cst) returns a new Link with sender sndr, receiver rcvr, and cost cst. |
Method Summary | |
int |
getCost()
lnk.getCost() returns the cost for sending a Packet through lnk. |
java.lang.String |
getReceiver()
lnk.getReceiver() returns the name of the receiver for lnk. |
java.lang.String |
getSender()
lnk.getSender() returns the name of the sender for lnk. |
void |
sendPacket(Packet pkt)
lnk.sendPacket(pkt) sends pkt through lnk. |
void |
setCost(int c)
lnk.setCost(c) sets the cost for sending a Packet through lnk to c. |
java.lang.String |
toString()
lnk.toString() returns a string describing lnk. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static int INFINITY
Constructor Detail |
public Link(Router sndr, Router rcvr, int cst)
Method Detail |
public java.lang.String getSender()
public java.lang.String getReceiver()
public int getCost()
public void setCost(int c)
public void sendPacket(Packet pkt)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |