1 package org.splat.simer.admin;
3 import org.splat.dal.bo.som.ProgressState;
4 import org.splat.dal.bo.som.Scenario;
5 import org.splat.dal.bo.som.Study;
6 import org.splat.service.technical.ProjectSettingsService;
9 public class ProjectElementFacade {
11 private transient final long _index; // For checking the equality between ProjectElementFacade objects
12 private transient final Study _my;
13 private transient final String _subtitle;
14 private transient final String _step;
16 // ==============================================================================================================================
18 // ==============================================================================================================================
20 public ProjectElementFacade (final Study represented, final ProjectSettingsService.Step at) {
21 // ------------------------------------------------------------------------
22 _index = represented.getIndex(); // The index of scenarios AND studies are unique
25 _step = "0." + at.getNumber();
27 public ProjectElementFacade (final Scenario represented, final ProjectSettingsService.Step at) {
28 // ---------------------------------------------------------------------------
29 _index = represented.getIndex(); // The index of scenarios AND studies are unique
30 _my = represented.getOwnerStudy();
31 _subtitle = ", " + represented.getTitle();
32 _step = String.valueOf(_index) + "." + at.getNumber();
35 // ==============================================================================================================================
36 // Services for not duplicating Study facades into a Set
37 // ==============================================================================================================================
40 public boolean equals (final Object other) {
41 // ------------------------------------
42 return (this.hashCode() == other.hashCode());
45 public int hashCode () {
46 // ----------------------
50 // ==============================================================================================================================
52 // ==============================================================================================================================
54 public String getAuthorName () {
55 // ------------------------------
56 return _my.getAuthor().getDisplayName();
58 public ProgressState getProgressState () {
59 // ----------------------------------------
60 return _my.getProgressState();
62 public String getReference () {
63 // -----------------------------
64 return _my.getReference();
66 public String getSelection () {
67 // -----------------------------
70 public String getStudyIndex () {
71 // ------------------------------
72 return String.valueOf(_my.getIndex());
74 public String getTitle () {
75 // -------------------------
76 return _my.getTitle() + _subtitle;