source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19115_2_2009_metadata___imagery/data_quality_information___imagery/qe_coverageresult.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19115_2_2009_metadata___imagery/data_quality_information___imagery/qe_coverageresult.py@8457
Revision 8457, 3.8 KB checked in by mnagni, 7 years ago (diff)

Corrected an error in the generation of the classes "synchronize" method.

  • Property svn:mime-type set to text/plain
Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_result import  DQ_Result
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 10-Jul-2012 14:15:12
26
27@author: mnagni
28'''
29
30class QE_CoverageResult(DQ_Result):
31        '''
32                Represents a data entity defined in a UML diagram and supposed to
33                be persisted in a relational database.
34 
35                This class has been genererated automatically using the Apache Velocity project.
36        '''
37        '''
38                Please note that any access to the inner attributes should be done using
39                the given get/set methods and NOT accessing them directly.
40        '''
41        def __init__(self):
42                self._dq_result = DQ_Result()   
43
44                self.spatialRepresentationType = None
45                self._resultContentDescription_md_imagedescription = None
46                self._resultContentDescription_mi_coveragedescription = None
47                self._resultContentDescription = None
48                self._resultSpatialRepresentation_md_vectorspatialrepresentation = None
49                self._resultSpatialRepresentation_md_gridspatialrepresentation = None
50                self._resultSpatialRepresentation = None
51                self.resultFormat = None
52                self.resultFile = None
53                super(QE_CoverageResult, self).__init__()
54        @property
55        def resultContentDescription(self):     
56                if(has_value(self._resultContentDescription_md_imagedescription)):
57                        return self._resultContentDescription_md_imagedescription
58                if(has_value(self._resultContentDescription_mi_coveragedescription)):
59                        return self._resultContentDescription_mi_coveragedescription
60                return  None
61
62        @resultContentDescription.setter
63        def resultContentDescription(self, value):     
64                valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
65                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.content_information.md_imagedescription.MD_ImageDescription":
66                        self._resultContentDescription_md_imagedescription = value
67                        self._resultContentDescription_mi_coveragedescription = None
68                if valueClass == "ea_model.iso_19115_2_2009_metadata___imagery.content_information___imagery.mi_coveragedescription.MI_CoverageDescription":
69                        self._resultContentDescription_mi_coveragedescription = value
70                        self._resultContentDescription_md_imagedescription = None
71        @property
72        def resultSpatialRepresentation(self): 
73                if(has_value(self._resultSpatialRepresentation_md_vectorspatialrepresentation)):
74                        return self._resultSpatialRepresentation_md_vectorspatialrepresentation
75                if(has_value(self._resultSpatialRepresentation_md_gridspatialrepresentation)):
76                        return self._resultSpatialRepresentation_md_gridspatialrepresentation
77                return  None
78
79        @resultSpatialRepresentation.setter
80        def resultSpatialRepresentation(self, value):   
81                valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
82                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.spatial_representation_information.md_vectorspatialrepresentation.MD_VectorSpatialRepresentation":
83                        self._resultSpatialRepresentation_md_vectorspatialrepresentation = value
84                        self._resultSpatialRepresentation_md_gridspatialrepresentation = None
85                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.spatial_representation_information.md_gridspatialrepresentation.MD_GridSpatialRepresentation":
86                        self._resultSpatialRepresentation_md_gridspatialrepresentation = value
87                        self._resultSpatialRepresentation_md_vectorspatialrepresentation = None
88
89        def synchronize(self):
90                pass
91
92        def __key(self):
93                return (self.spatialRepresentationType, self.resultContentDescription, self.resultSpatialRepresentation, self.resultFormat, self.resultFile)
94
95        def __eq__(self, y):
96                if type(self) != type(y):
97                        return False
98                '''
99                Cannot compare classes which do not define a "__key" attribute
100                '''
101                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
102                        return self.__key() == y.__key()
103                return id(self) == id(y)
104
105        def __hash__(self):
106                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.