sims.mar
Class MachineARegistre

java.lang.Object
  extended by java.lang.Thread
      extended by sims.mar.MachineARegistre
All Implemented Interfaces:
java.lang.Runnable, InterfaceSimulation

public class MachineARegistre
extends java.lang.Thread
implements InterfaceSimulation

Control le programme de la machine à registre (Simulateur) Appeler la methode start pour demarrer la machine dans un nouveau thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 Programme myProgramme
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface sims.InterfaceSimulation
VITESSES
 
Constructor Summary
MachineARegistre()
           
 
Method Summary
 void arreter()
           
 void attendreLaFin()
          Attend la fin de l'execution de la machine
 void charger(java.io.File file)
          Charge un fichier
 void charger(java.lang.String fileName)
           
 void decharger()
           
 void decVitesse()
           
 void demarrer()
           
 boolean estArrete()
           
 java.lang.String getNom()
           
 java.util.Collection getPointArret()
           
 Programme getProgramme()
           
 int getVitesse()
           
 void incVitesse()
           
 void prochainPas()
           
 void reinitialiser()
           
 void run()
          Lance la machine Pour savoir quand l'execution est terminé utiliser @see #attendreLaFin() La machine s'arrete si elle arrive sur un point d'arret elle repare quand on appel la methode reprendre
 void setAction(ActionMAR action)
           
 void tuer()
           
 
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

myProgramme

public Programme myProgramme
Constructor Detail

MachineARegistre

public MachineARegistre()
Method Detail

getNom

public java.lang.String getNom()
Specified by:
getNom in interface InterfaceSimulation
Returns:
le nom de la machine

getVitesse

public int getVitesse()
Specified by:
getVitesse in interface InterfaceSimulation
Returns:
la vitesse de la machine

getPointArret

public java.util.Collection getPointArret()
Returns:
les point d'arret (Collection d'Instruction)

getProgramme

public Programme getProgramme()
Returns:
le programme associé à la machine

run

public void run()
Lance la machine Pour savoir quand l'execution est terminé utiliser @see #attendreLaFin() La machine s'arrete si elle arrive sur un point d'arret elle repare quand on appel la methode reprendre

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

setAction

public void setAction(ActionMAR action)

decharger

public void decharger()

charger

public void charger(java.io.File file)
             throws java.io.IOException,
                    ExceptionCompilation
Charge un fichier

Parameters:
path - chemin du fichier
Throws:
java.io.IOException
ExceptionCompilation

charger

public void charger(java.lang.String fileName)
             throws java.io.IOException,
                    ExceptionCompilation
Throws:
java.io.IOException
ExceptionCompilation

tuer

public void tuer()

estArrete

public boolean estArrete()

demarrer

public void demarrer()
Specified by:
demarrer in interface InterfaceSimulation

arreter

public void arreter()
Specified by:
arreter in interface InterfaceSimulation

reinitialiser

public void reinitialiser()
Specified by:
reinitialiser in interface InterfaceSimulation

prochainPas

public void prochainPas()
Specified by:
prochainPas in interface InterfaceSimulation

incVitesse

public void incVitesse()
Specified by:
incVitesse in interface InterfaceSimulation

decVitesse

public void decVitesse()
Specified by:
decVitesse in interface InterfaceSimulation

attendreLaFin

public void attendreLaFin()
                   throws java.lang.InterruptedException
Attend la fin de l'execution de la machine

Throws:
java.lang.InterruptedException