|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
User
The class creates token then Passes token to neighbour NIC and holds token while the resource in use bu user
| Field Summary | |
protected static boolean |
loop
Thread looping flag |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Fields inherited from interface Actions |
EXIT, NOPASSING, PASS, PASSTOKEN, READ |
| Constructor Summary | |
User(NIC card)
Constructor that creates an instance of BufferedReader to read from console.Throws Exception if error occur in creating IO |
|
User(NIC card,
String out)
Constructor that creates an instance of BufferedReader to read from console.Throws Exception if error occur in creating IO |
|
| Method Summary | |
(package private) void |
Exit()
Terminate user thread and NIC thread |
void |
run()
The run method prints the sentence in the form of tokens input by user from the console or constructor |
void |
setInputter()
Method should be called before if the user thread will be asked to take user input |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static boolean loop
| Constructor Detail |
public User(NIC card)
throws Exception
public User(NIC card,
String out)
throws Exception
| Method Detail |
void Exit()
public void run()
run in interface Runnablepublic void setInputter()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||