source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19136_gml/dynamicfeature/dynamicfeaturecollection.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19136_gml/dynamicfeature/dynamicfeaturecollection.py@8457
Revision 8457, 3.1 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_19136_gml.dynamicfeature.dynamicfeature import  DynamicFeature
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 10-Jul-2012 14:15:11
26
27@author: mnagni
28'''
29
30class DynamicFeatureCollection(DynamicFeature):
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._dynamicfeature = DynamicFeature()         
43
44                self.identifier = None
45                self.boundedBy = None
46                self.dataSource = None
47                self.validTime = None
48                self.dynamicMembers = []
49                self.description = None
50                self.descriptionReference = None
51                self.dataSourceReference = None
52                super(DynamicFeatureCollection, self).__init__()
53        @property
54        def identifier(self):   
55                return self._dynamicfeature.identifier
56
57        @identifier.setter
58        def identifier(self, value):   
59                        self._dynamicfeature.identifier = value
60        @property
61        def boundedBy(self):   
62                return self._dynamicfeature.boundedBy
63
64        @boundedBy.setter
65        def boundedBy(self, value):     
66                        self._dynamicfeature.boundedBy = value
67        @property
68        def name(self):
69                return self._dynamicfeature.name
70
71        @name.setter
72        def name(self, value): 
73                        self._dynamicfeature.name = value
74        @property
75        def history(self):     
76                return self._dynamicfeature.history
77
78        @history.setter
79        def history(self, value):       
80                        self._dynamicfeature.history = value
81        @property
82        def dataSource(self):   
83                return self._dynamicfeature.dataSource
84
85        @dataSource.setter
86        def dataSource(self, value):   
87                        self._dynamicfeature.dataSource = value
88        @property
89        def validTime(self):   
90                return self._dynamicfeature.validTime
91
92        @validTime.setter
93        def validTime(self, value):     
94                        self._dynamicfeature.validTime = value
95        @property
96        def description(self): 
97                return self._dynamicfeature.description
98
99        @description.setter
100        def description(self, value):   
101                        self._dynamicfeature.description = value
102        @property
103        def descriptionReference(self):
104                return self._dynamicfeature.descriptionReference
105
106        @descriptionReference.setter
107        def descriptionReference(self, value): 
108                        self._dynamicfeature.descriptionReference = value
109        @property
110        def dataSourceReference(self): 
111                return self._dynamicfeature.dataSourceReference
112
113        @dataSourceReference.setter
114        def dataSourceReference(self, value):   
115                        self._dynamicfeature.dataSourceReference = value
116
117        def synchronize(self):
118                pass
119
120        def __key(self):
121                return (self.identifier, self.boundedBy, self.name, self.history, self.dataSource, self.validTime, self.dynamicMembers, self.description, self.descriptionReference, self.dataSourceReference)
122
123        def __eq__(self, y):
124                if type(self) != type(y):
125                        return False
126                '''
127                Cannot compare classes which do not define a "__key" attribute
128                '''
129                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
130                        return self.__key() == y.__key()
131                return id(self) == id(y)
132
133        def __hash__(self):
134                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.