--- /dev/null
+package org.splat.dal.bo.som;
+/**
+ *
+ * @author Daniel Brunier-Coulin
+ * @copyright OPEN CASCADE 2012
+ */
+
+import java.util.Comparator;
+import java.util.Date;
+
+import org.splat.dal.bo.kernel.Any;
+import org.splat.dal.bo.kernel.Attribute;
+import org.splat.dal.bo.kernel.User;
+
+
+public class Timestamp extends Any {
+
+ private StampRelation context;
+ private ValidationStep mytype;
+ private User author;
+ private Date sdate;
+
+ public static class ComparatorByDate implements Comparator<Timestamp> {
+// ---------------------------------------------------------------------
+ public int compare(Timestamp t1, Timestamp t2)
+ {
+ return t1.getDate().compareTo(t2.getDate());
+ }
+ }
+
+// ==============================================================================================================================
+// Construction
+// ==============================================================================================================================
+
+// Database fetch constructor
+ protected Timestamp () {
+ }
+// Internal constructors
+ public Timestamp (ValidationStep type, Document from, User to, Date sdate) {
+// -----------------------------------------------------------------------------
+ super((Attribute)null); // For building the collection of attributes
+ this.mytype = type;
+ this.author = to;
+ this.sdate = sdate;
+ this.context = new StampRelation(from, this);
+ }
+
+// ==============================================================================================================================
+// Public member functions
+// ==============================================================================================================================
+
+ public User getAuthor () {
+// ------------------------
+ return author;
+ }
+
+ public String getComment () {
+// ---------------------------
+ CommentAttribute field = (CommentAttribute)this.getAttribute(CommentAttribute.class);
+ String result = null;
+ if (field != null) result = field.getValue();
+ return result;
+ }
+
+ public Date getDate () {
+// ----------------------
+ return sdate;
+ }
+
+ public ValidationStep getType () {
+// --------------------------------
+ return mytype;
+ }
+
+ public void setComment (String comment) {
+// ---------------------------------------
+ if (comment != null) this.setAttribute( new CommentAttribute(this, comment) );
+ }
+
+// ==============================================================================================================================
+// Protected services
+// ==============================================================================================================================
+
+ protected StampRelation getContext () {
+// -------------------------------------
+ return context;
+ }
+}
\ No newline at end of file