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 _index = represented.getIndex(); // The index of scenarios AND studies are unique
24 _step = "0." + at.getNumber();
26 public ProjectElementFacade (final Scenario represented, final ProjectSettingsService.Step at) {
27 _index = represented.getIndex(); // The index of scenarios AND studies are unique
28 _my = represented.getOwnerStudy();
29 _subtitle = ", " + represented.getTitle();
30 _step = String.valueOf(_index) + "." + at.getNumber();
33 // ==============================================================================================================================
34 // Services for not duplicating Study facades into a Set
35 // ==============================================================================================================================
38 public boolean equals (final Object other) {
39 return (this.hashCode() == other.hashCode());
42 public int hashCode () {
46 // ==============================================================================================================================
48 // ==============================================================================================================================
50 public String getAuthorName () {
51 return _my.getAuthor().getDisplayName();
53 public ProgressState getProgressState () {
54 return _my.getProgressState();
56 public String getReference () {
57 return _my.getReference();
59 public String getSelection () {
62 public String getStudyIndex () {
63 return String.valueOf(_my.getIndex());
65 public String getTitle () {
66 return _my.getTitle() + _subtitle;