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  
23  package fr.ens.transcriptome.doelan.data;
24  
25  import org.apache.log4j.Logger;
26  
27  import fr.ens.transcriptome.nividic.platform.PlatformException;
28  import fr.ens.transcriptome.nividic.platform.data.Data;
29  import fr.ens.transcriptome.nividic.platform.data.DataDefaults;
30  import fr.ens.transcriptome.nividic.platform.module.AboutModule;
31  import fr.ens.transcriptome.nividic.platform.module.Module;
32  import fr.ens.transcriptome.nividic.platform.module.ModuleDescription;
33  import fr.ens.transcriptome.nividic.util.SystemUtils;
34  
35  /***
36   * Wrapper of QualityUnitTestResult.
37   *
38   * @author Laurent Jourdren
39   */
40  public class QualityUnitTestResultData extends Data implements Module {
41  
42    //For logging system
43    private static Logger log = Logger.getLogger(QualityUnitTestResultData.class);
44  
45    /***
46     * Get the name of the data.
47     * @return The name of the data
48     */
49    public String getName() {
50      return SystemUtils
51      .getClassNameWithoutPackage(QualityUnitTestResultData.class);
52    }
53  
54    /***
55     * Get the format of the data.
56     * @return The name of the format of the data
57     */
58    public String getFormat() {
59      return DataDefaults.OM_FORMAT;
60    }
61  
62    /***
63     * Get the type of the data.
64     * @return The type of the data.
65     */
66    public String getType() {
67  
68      return DoelanDataDefaults.UNIT_TEST_RESULT_TYPE;
69    }
70  
71    /***
72     * Get the class of the data.
73     * @return The class of the data.
74     */
75    public Class getDataClass() {
76      return QualityUnitTestResult.class;
77    }
78  
79    /***
80     * Set the Result.
81     * @param result Result to set
82     */
83    public void setData(final QualityUnitTestResult result) {
84  
85      try {
86        super.setData(result);
87      } catch (PlatformException e) {
88        log.error("Cast exception");
89      }
90    }
91  
92    /***
93     * Get the description of the module.
94     * @return The description of the module
95     */
96    public AboutModule aboutModule() {
97  
98      ModuleDescription md = null;
99      try {
100       md = new ModuleDescription("QualityUnitTestResult", "QualityUnitTest result data type");
101     } catch (PlatformException e) {
102       log.error("Unable to create module description");
103     }
104     return md;
105   }
106 
107   //
108   // Constructor
109   //
110 
111   /***
112    * Public constructor.
113    * @param result Result of a QualityUnitTest
114    */
115   public QualityUnitTestResultData(final QualityUnitTestResult result) {
116     setData(result);
117   }
118 
119 }