Salome HOME
Remove study method is implemented. Unit test is added.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / dal / bo / som / ProjectElement.java
index bf08b16ff78e281bd56f71348b1935ef35289f69..62d1e876af8c1c2a65594b35d5408de1abc2275f 100644 (file)
@@ -22,15 +22,36 @@ import org.splat.kernel.MultiplyDefinedException;
 import org.splat.kernel.ObjectProperties;
 import org.splat.som.Step;
 
+/**
+ * Persistent project element class. It can be study or scenario.
+ */
 public abstract class ProjectElement extends Entity {
 
        // Persistent fields
+       /**
+        * Persistent field: project element title.
+        */
        protected String title;
+       /**
+        * Persistent field: project element author/manager.
+        */
        protected User manager;
-       protected Date credate; // Object creation date
-       protected Date lasdate; // Object Last modification date
-       private final List<SimulationContext> contex = new Vector<SimulationContext>(); // Structured by the Step transient class
-       private final Set<Publication> docums = new LinkedHashSet<Publication>(); // Structured by the Step transient class
+       /**
+        * Persistent field: object creation date.
+        */
+       protected Date credate;
+       /**
+        * Persistent field: object last modification date.
+        */
+       protected Date lasdate;
+       /**
+        * Persistent field: simulation contexts structured by the Step transient class.
+        */
+       private final List<SimulationContext> contex = new Vector<SimulationContext>();
+       /**
+        * Persistent field: documents publications structured by the Step transient class.
+        */
+       private final Set<Publication> docums = new LinkedHashSet<Publication>();
 
        /**
         * Transient array of steps (folders).
@@ -181,18 +202,46 @@ public abstract class ProjectElement extends Entity {
        // Protected member functions
        // ==============================================================================================================================
 
+       /**
+        * Add a document publication to the project element.
+        * 
+        * @param newdoc
+        *            the publication to add
+        * @return true if added successfully, otherwise false
+        */
        public boolean add(final Publication newdoc) {
                return docums.add(newdoc);
        }
 
+       /**
+        * Add a simulation context to the project element.
+        * 
+        * @param newdoc
+        *            the simulation context to add
+        * @return true if added successfully, otherwise false
+        */
        public boolean add(final SimulationContext newdoc) {
                return contex.add(newdoc);
        }
 
+       /**
+        * Remove the document publication from the project element.
+        * 
+        * @param oldoc
+        *            the publication to remove
+        * @return true if removed successfully, otherwise false
+        */
        public boolean remove(final Publication oldoc) {
                return docums.remove(oldoc); // The removed tag becoming orphan, it is supposed automatically deleted from the data store
        }
 
+       /**
+        * Remove the simulation context from the project element.
+        * 
+        * @param oldoc
+        *            the simulation context to remove
+        * @return true if removed successfully, otherwise false
+        */
        public boolean remove(final SimulationContext oldoc) {
                return contex.remove(oldoc);
        }