|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectlanSimulation.Network
A Network represents the basic data stucture for simulating a Local Area Network (LAN). The LAN network architecture is a token ring, implying that packahes will be passed from one node to another, until they reached their destination, or until they travelled the whole token ring.
| Constructor Summary | |
Network(int size)
Construct a Network suitable for holding #size Workstations. |
|
| Method Summary | |
boolean |
consistentNetwork()
Answer whether #receiver is a consistent token ring network. |
static Network |
DefaultExample()
Return a Network that may serve as starting point for various experiments. |
boolean |
hasWorkstation(java.lang.String ws)
Answer whether #receiver contains a workstation with the given name. |
boolean |
isInitialized()
Answer whether #receiver is properly initialized. |
void |
printHTMLOn(java.lang.StringBuffer buf)
Write a HTML representation of #receiver on the given #buf. |
void |
printOn(java.lang.StringBuffer buf)
Write a printable representation of #receiver on the given #buf. |
void |
printXMLOn(java.lang.StringBuffer buf)
Write an XML representation of #receiver on the given #buf. |
boolean |
requestBroadcast(java.io.Writer report)
The #receiver is requested to broadcast a message to all nodes. |
boolean |
requestWorkstationPrintsDocument(java.lang.String workstation,
java.lang.String document,
java.lang.String printer,
java.io.Writer report)
The #receiver is requested by #workstation to print #document on #printer. |
java.lang.String |
toString()
Return a printable representation of #receiver. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Network(int size)
Postcondition:(result.isInitialized()) & (! result.consistentNetwork());
| Method Detail |
public static Network DefaultExample()
Workstation Filip [Workstation] -> Node -> Workstation Hans [Workstation]
-> Printer Andy [Printer] -> ...
Postcondition:result.isInitialized() & result.consistentNetwork();
public boolean isInitialized()
public boolean hasWorkstation(java.lang.String ws)
Precondition:this.isInitialized();
public boolean consistentNetwork()
Precondition:this.isInitialized();
public boolean requestBroadcast(java.io.Writer report)
Precondition: consistentNetwork();
report - Stream that will hold a report about what happened when handling the request.
public boolean requestWorkstationPrintsDocument(java.lang.String workstation,
java.lang.String document,
java.lang.String printer,
java.io.Writer report)
Precondition: consistentNetwork() & hasWorkstation(workstation);
workstation - Name of the workstation requesting the service.document - Contents that should be printed on the printer.printer - Name of the printer that should receive the document.report - Stream that will hold a report about what happened when handling the request.
public java.lang.String toString()
Precondition: isInitialized();
public void printOn(java.lang.StringBuffer buf)
Precondition: isInitialized();
public void printHTMLOn(java.lang.StringBuffer buf)
Precondition: isInitialized();
public void printXMLOn(java.lang.StringBuffer buf)
Precondition: isInitialized();
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||