A C E G I L M N P R S T U

A

Actions - interface Actions.
The interface defines some actions that User and and there nodes i.e NIC will use to pass and get tokens Other actions are also declared to check user input flag

C

CJmain - class CJmain.
Main class to create user threads
CJmain() - Constructor for class CJmain
 
checkStatus() - Method in class NIC
Check status and pass token
createToken() - Method in class NIC
create the token intially and set status to pass The method should call before starting thread
createToken() - Static method in class Token
Creates Token object and return

E

EXIT - Static variable in interface Actions
 
Exit() - Method in class NIC
This methods terminates the run method by setting flag
Exit() - Method in class User
Terminate user thread and NIC thread
exchangeToken(Token) - Method in class NIC
exchanges token value from neighbour NIC

G

getToken() - Method in class NIC
Return token reference

I

initialize() - Static method in class Ring
 
intRead() - Method in class Read
takes input from user breaks it into integer token and return

L

loop - Static variable in class NIC
Thread looping flag
loop - Static variable in class User
Thread looping flag

M

main(String[]) - Static method in class CJmain
 

N

NIC - class NIC.
The class creates token then Passes token to neighbour NIC and holds token while the resource in use bu user
NIC() - Constructor for class NIC
Constructor set the intital status to NOPASSING
NOPASSING - Static variable in interface Actions
 

P

PASS - Static variable in interface Actions
 
PASSTOKEN - Static variable in interface Actions
 
print(String) - Static method in class Resource
Method to print string message as a token to standard output

R

READ - Static variable in interface Actions
 
Read - class Read.
This class takes command line input from user The class is based on book example (Horton, 2000 pp.378-379) Beginning JAVA 2.
Read() - Constructor for class Read
Creates command line reader
Resource - class Resource.
The class allow the users NIC to print message on resource
Ring - class Ring.
 
Ring() - Constructor for class Ring
 
run() - Method in class NIC
 
run() - Method in class User
The run method prints the sentence in the form of tokens input by user from the console or constructor

S

setInputter() - Method in class User
Method should be called before if the user thread will be asked to take user input
setNeighbour(NIC) - Method in class NIC
set neighbout NIC to communicate and pass token The method should call before starting thread
setStatus() - Method in class NIC
change status to pass token

T

Token - class Token.
Singleton class that creates token and return token only to the first creator otherwise it returns null The first user will only get the token and other will get null means no token

U

User - class User.
The class creates token then Passes token to neighbour NIC and holds token while the resource in use bu user
User(NIC, String) - Constructor for class User
Constructor that creates an instance of BufferedReader to read from console.Throws Exception if error occur in creating IO
User(NIC) - Constructor for class User
Constructor that creates an instance of BufferedReader to read from console.Throws Exception if error occur in creating IO

A C E G I L M N P R S T U