Advertisement
Guest User

putAll

a guest
Jul 30th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. public synchronized void putAll(Vector <T> vecteur ){
  2.         while(!liste.isEmpty()){
  3.             try{
  4.                 this.wait();//mise en attente
  5.             }catch(InterruptedException e){}
  6.         }
  7.         for(int i = 0; i<liste.size();++i){
  8.             liste.set(i, vecteur.get(i)); //remplace liste[i] par element (ds le cas ou la liste est vide add devrait produire le mm effet
  9.         }
  10.         this.notifyAll();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement