Class Philosopher

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--Philosopher

class Philosopher
extends java.lang.Thread

The philosopher class INPUT: none OUTPUT: none


Field Summary
(package private)  int me
           
(package private)  PhilosopherApplet pa
           
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
Philosopher(PhilosopherApplet phillApp, int _me)
          Initialize the philosopher class INPUT: phillApp, link to main _me , ID number OUTPUT: none
 
Method Summary
(package private)  void activity(int n, java.awt.Color c)
          The thread for each philosopher.
(package private)  void eat()
          Defines what the color will be with the assorted acction INPUT: none OUTPUT: none
(package private)  void hungry()
          Defines what the color will be with the assorted action INPUT: none OUTPUT: none
 int left()
          Not used, not needed.
 int right()
          Not used, not needed.
 void run()
          Change the modes.
(package private)  void think()
          Defines what the color will be with the assorted action INPUT: none OUTPUT: none
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pa

PhilosopherApplet pa

me

int me
Constructor Detail

Philosopher

public Philosopher(PhilosopherApplet phillApp,
                   int _me)
Initialize the philosopher class INPUT: phillApp, link to main _me , ID number OUTPUT: none
Method Detail

run

public void run()
Change the modes. INPUT: none OUTPUT: none
Overrides:
run in class java.lang.Thread

left

public int left()
Not used, not needed. yet INPUT: none OUTPUT: none

right

public int right()
Not used, not needed. yet INPUT: none OUTPUT: none

activity

void activity(int n,
              java.awt.Color c)
The thread for each philosopher. also holds how long it will sleep INPUT: n, ID number color, activity color OUTPUT: none

think

void think()
Defines what the color will be with the assorted action INPUT: none OUTPUT: none

hungry

void hungry()
Defines what the color will be with the assorted action INPUT: none OUTPUT: none

eat

void eat()
Defines what the color will be with the assorted acction INPUT: none OUTPUT: none