graphe
Class ElectionJeton

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--graphe.Sommet
              |
              +--graphe.ElectionJeton
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ColorationJeton

public abstract class ElectionJeton
extends Sommet

Classe ElectionJeton. Cette classe permet de gérer les élections dans le graphe sur le principe de la circulation de jeton.

Version:
1.0
Author:
Estelle Colin, Thomas Peclier, Fabrice Berna @ IUP GMI
See Also:

Field Summary
(package private)  int chef
           
 java.lang.String etat
           
(package private)  int initiateurId
           
(package private)  java.lang.String message
           
private  int prochain
           
(package private)  java.util.StringTokenizer strToken
           
private  int[] Tpere
           
private  boolean[][] Tvoisins
           
 
Fields inherited from class graphe.Sommet
fin, id, nbSommet, nbvoisins, voisins, voisinsId
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ElectionJeton(int i, int nb, boolean[] v, javax.swing.JTextArea out)
           
 
Method Summary
 void candidature(int init, int couleurReçue)
          Methode abstraite
 void etat()
          Etat du sommet
private  int extraire(int t)
           
private  boolean faire_suivre(int j, java.lang.String s, int k)
           
private  void initier(java.lang.String s)
           
abstract  void initierColoration()
          Méthode abstraite
 void interprete(java.lang.String s, int i)
          Méthode d'interprétation des messages reçus
(package private)  void sur_reception_conf(int j, java.lang.String s, int k)
           
(package private)  void sur_reception_de(int j, java.lang.String s, int k)
           
(package private)  void sur_reception_req(int j, java.lang.String s, int k)
           
 
Methods inherited from class graphe.Sommet
cancel, ecrit, getDuree, getEcrivain, getLecteur, getNbMess, getNbMessCouleur, initTubes, lit, println, run
 
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

Tvoisins

private boolean[][] Tvoisins

Tpere

private int[] Tpere

prochain

private int prochain

initiateurId

int initiateurId

chef

int chef

etat

public java.lang.String etat

message

java.lang.String message

strToken

java.util.StringTokenizer strToken
Constructor Detail

ElectionJeton

public ElectionJeton(int i,
                     int nb,
                     boolean[] v,
                     javax.swing.JTextArea out)
Method Detail

extraire

private final int extraire(int t)

initier

private final void initier(java.lang.String s)
                    throws java.io.IOException
java.io.IOException

sur_reception_de

final void sur_reception_de(int j,
                            java.lang.String s,
                            int k)
                     throws java.io.IOException
java.io.IOException

faire_suivre

private final boolean faire_suivre(int j,
                                   java.lang.String s,
                                   int k)
                            throws java.io.IOException
java.io.IOException

candidature

public final void candidature(int init,
                              int couleurReçue)
                       throws java.io.IOException
Description copied from class: Sommet
Methode abstraite

Specified by:
candidature in class Sommet
java.io.IOException

sur_reception_req

final void sur_reception_req(int j,
                             java.lang.String s,
                             int k)
                      throws java.io.IOException
java.io.IOException

sur_reception_conf

final void sur_reception_conf(int j,
                              java.lang.String s,
                              int k)
                       throws java.io.IOException
java.io.IOException

interprete

public void interprete(java.lang.String s,
                       int i)
                throws java.io.IOException
Méthode d'interprétation des messages reçus

Specified by:
interprete in class Sommet
java.io.IOException

etat

public void etat()
Etat du sommet

Overrides:
etat in class Sommet

initierColoration

public abstract void initierColoration()
                                throws java.io.IOException
Méthode abstraite

java.io.IOException