All pastes #45194 Raw Edit

disp

public java v1 · immutable
#45194 ·published 2006-03-10 22:47 UTC
rendered paste body
import java.util.ArrayList;import java.lang.InterruptedException;import java.lang.IllegalMonitorStateException;public class Dispatch{  public ArrayList < String > msg;  public Dispatch ()  {    msg = new ArrayList < String > (1);    boolean ok = true;    while (ok)      {	while (msg.size () != 0)	  {	    for (int i = 0; i < 5; i++)	      {		System.out.println (i + "  " + msg.get (0));		i++;	      }	    msg.remove (0);	  }	try	{	  msg.wait ();	}	catch (InterruptedException e)	{	  System.out.println ("01 " + e.getMessage ());	}	catch (IllegalMonitorStateException e)	{	  System.out.println ("02 " + e.getMessage ());	}      }  }				//Dispatch   synchronized public void readMsg (String chaine)  {  }				//addMsg}				//class