1 package org.splat.dal.bo.som;
4 * @author Daniel Brunier-Coulin
5 * @copyright OPEN CASCADE 2012
8 import java.util.Comparator;
11 import org.splat.dal.bo.kernel.Any;
12 import org.splat.dal.bo.kernel.Attribute;
13 import org.splat.dal.bo.kernel.User;
16 public class Timestamp extends Any {
18 private StampRelation context;
19 private ValidationStep mytype;
23 public static class ComparatorByDate implements Comparator<Timestamp> {
24 // ---------------------------------------------------------------------
25 public int compare(Timestamp t1, Timestamp t2)
27 return t1.getDate().compareTo(t2.getDate());
31 // ==============================================================================================================================
33 // ==============================================================================================================================
35 // Database fetch constructor
36 protected Timestamp () {
38 // Internal constructors
39 public Timestamp (ValidationStep type, Document from, User to, Date sdate) {
40 // -----------------------------------------------------------------------------
41 super((Attribute)null); // For building the collection of attributes
45 this.context = new StampRelation(from, this);
48 // ==============================================================================================================================
49 // Public member functions
50 // ==============================================================================================================================
52 public User getAuthor () {
53 // ------------------------
57 public String getComment () {
58 // ---------------------------
59 CommentAttribute field = (CommentAttribute)this.getAttribute(CommentAttribute.class);
61 if (field != null) result = field.getValue();
65 public Date getDate () {
66 // ----------------------
70 public ValidationStep getType () {
71 // --------------------------------
75 public void setComment (String comment) {
76 // ---------------------------------------
77 if (comment != null) this.setAttribute( new CommentAttribute(this, comment) );
80 // ==============================================================================================================================
82 // ==============================================================================================================================
84 protected StampRelation getContext () {
85 // -------------------------------------