View Javadoc

1   /*
2    *                Doelan development code
3    *
4    * This code may be freely distributed and modified under the
5    * terms of the GNU General Public Licence.  This should
6    * be distributed with the code. If you do not have a copy,
7    * see:
8    *
9    *      http://www.gnu.org/copyleft/gpl.txt
10   *
11   * Copyright (c) 2004-2005 ENS Microarray Platform
12   * Copyright for this code is held jointly by the individual
13   * authors.  These should be listed in @author doc comments.
14   *
15   * For more information on the Doelan project and its aims,
16   * or to join the Doelan mailing list, visit the home page
17   * at:
18   *
19   *      http://www.transcriptome.ens.fr/doelan
20   */
21  
22  package fr.ens.transcriptome.doelan.data;
23  
24  import org.apache.log4j.Logger;
25  
26  import fr.ens.transcriptome.nividic.platform.PlatformException;
27  import fr.ens.transcriptome.nividic.platform.data.Data;
28  import fr.ens.transcriptome.nividic.platform.data.DataDefaults;
29  import fr.ens.transcriptome.nividic.platform.module.AboutModule;
30  import fr.ens.transcriptome.nividic.platform.module.Module;
31  import fr.ens.transcriptome.nividic.platform.module.ModuleDescription;
32  import fr.ens.transcriptome.nividic.util.SystemUtils;
33  
34  /***
35   * Wrapper of QualityGlobalTestResult.
36   * @author Laurent Jourdren
37   */
38  public class QualityGlobalTestResultData extends Data implements Module {
39  
40    //For logging system
41    private static Logger log = Logger.getLogger(QualityUnitTestResultData.class);
42  
43    /***
44     * Get the name of the data.
45     * @return The name of the data
46     */
47    public String getName() {
48      return SystemUtils
49          .getClassNameWithoutPackage(QualityGlobalTestResultData.class);
50    }
51  
52    /***
53     * Get the format of the data.
54     * @return The name of the format of the data
55     */
56    public String getFormat() {
57      return DataDefaults.OM_FORMAT;
58    }
59  
60    /***
61     * Get the type of the data.
62     * @return The type of the data.
63     */
64    public String getType() {
65  
66      return DoelanDataDefaults.GLOBAL_TEST_RESULT_TYPE;
67    }
68  
69    /***
70     * Get the class of the data.
71     * @return The class of the data.
72     */
73    public Class getDataClass() {
74      return QualityGlobalTestResult.class;
75    }
76  
77    /***
78     * Set the Result.
79     * @param result Result to set
80     */
81    public void setData(final QualityGlobalTestResult result) {
82  
83      try {
84        super.setData(result);
85      } catch (PlatformException e) {
86        log.error("Cast exception");
87      }
88    }
89  
90    /***
91     * Get the description of the module.
92     * @return The description of the module
93     */
94    public AboutModule aboutModule() {
95  
96      ModuleDescription md = null;
97      try {
98        md = new ModuleDescription("QualityGlobalTestResult",
99            "QualityUnitTest result data type");
100     } catch (PlatformException e) {
101       log.error("Unable to create module description");
102     }
103     return md;
104   }
105 
106   //
107   // Constructor
108   //
109 
110   /***
111    * Public constructor.
112    * @param result Result of a QualityUnitTest
113    */
114   public QualityGlobalTestResultData(final QualityGlobalTestResult result) {
115     setData(result);
116   }
117 
118 }