Class node

java.lang.Object
  extended by java.lang.Thread
      extended by node
All Implemented Interfaces:
java.lang.Runnable

public class node
extends java.lang.Thread

Clase node que implementa els threads i va enviant els missatges entre ells

Author:
LUIS

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 java.util.LinkedList<missatge> buffer
           
 int idnode
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
node(int idnode, int[][] matriu, dades d)
          Construcitor de la clase node *
 
Method Summary
 void add(missatge x)
          Funcio que afegeix un missatge al buffer del node fent servir syncrhonized
 missatge desapila()
          Funcio que desapila el primer missatge del buffer del node return : missatge
 void run()
          Funcio que te el cos del tread (el que fa)
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

idnode

public int idnode

buffer

public java.util.LinkedList<missatge> buffer
Constructor Detail

node

public node(int idnode,
            int[][] matriu,
            dades d)
Construcitor de la clase node *

Method Detail

desapila

public missatge desapila()
Funcio que desapila el primer missatge del buffer del node return : missatge


add

public void add(missatge x)
Funcio que afegeix un missatge al buffer del node fent servir syncrhonized


run

public void run()
Funcio que te el cos del tread (el que fa)

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread