Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Correction of some bugs and performance enhancement.
[jaceP2P.git] / src / jaceP2P / ListeTask.java
index 701b123..e355718 100644 (file)
@@ -1,13 +1,14 @@
 package jaceP2P;
 
-import java.util.Vector;
+import java.util.ArrayList;
+
 
 public class ListeTask implements java.io.Serializable, java.lang.Cloneable 
 {
        private static final long serialVersionUID = 1L ;
 
        // attributes
-       protected Vector<TaskId> liste = new Vector<TaskId>() ;
+       protected ArrayList<TaskId> liste = new ArrayList<TaskId>() ;
        protected TaskId task ;
 
        // constructor
@@ -16,14 +17,14 @@ public class ListeTask implements java.io.Serializable, java.lang.Cloneable
        @SuppressWarnings("unchecked")
        public synchronized ListeTask clone() {
                ListeTask l = new ListeTask();
-               l.liste = (Vector<TaskId>) liste.clone();
+               l.liste = (ArrayList<TaskId>) liste.clone();
                l.task = task;
                return (l);
        }
 
        // methods
        public synchronized void addTask(TaskId tsk) {
-               liste.addElement(tsk);
+               liste.add( tsk ) ;
        }
 
        public synchronized TaskId getTaskIdOfHostStub(JaceInterface hostStub) {
@@ -35,8 +36,7 @@ public class ListeTask implements java.io.Serializable, java.lang.Cloneable
                        if (is != -1) {
                                return (TaskId) liste.get(is);
                        } else {
-                               System.err
-                                               .println("There is no task affected to this host stub !");
+                               System.err.println("There is no task affected to this host stub !");
                                return null;
                        }
                }