All pastes #45193 Raw Edit

dispatch

public java v1 · immutable
#45193 ·published 2006-03-10 22:46 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()) ; }}}//Dispatchsynchronized public void readMsg (String chaine) {}//addMsg}//class