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).
// 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);
}