source: mauRepo/MolesManager/trunk/src/ea_model/iso_19129_2009_igcd/igcd_framework/if_cellvaluepair.py @ 8086

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19129_2009_igcd/igcd_framework/if_cellvaluepair.py@8086
Revision 8086, 2.5 KB checked in by mnagni, 8 years ago (diff)

Fixed the multiple CI_Party INSERT in the DB
Refactored the ingestion thanks to the new eq method in the imported classes DB library

Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18from ea_model.iso_19123_2005_coverages.coverages.discrete_coverages.cv_surfacevaluepair import  CV_SurfaceValuePair
19
20'''
21Created on 03-Feb-2012 10:41:15
22
23@author: mnagni
24'''
25
26class IF_CellValuePair(CV_SurfaceValuePair):
27    '''
28        Represents a data entity defined in a UML diagram and supposed to
29        be persisted in a relational database.
30 
31        This class has been genererated automatically using the Apache Velocity project.
32    '''
33    '''
34        Please note that any access to the inner attributes should be done using
35        the given get/set methods and NOT accessing them directly.
36    '''
37    def __init__(self):
38        self._cv_surfacevaluepair = CV_SurfaceValuePair()       
39
40        self._collection_cv_discretesolidcoverage = []
41        self._collection_cv_discretepointcoverage = []
42        self._collection_cv_discretecurvecoverage = []
43        self._collection_cv_discretesurfacecoverage = []
44        self._collection_cv_discretegridpointcoverage = []
45        self._collection_cvt_discretetimeinstantcoverage = []
46        self.collection = []
47        self.value = None
48        self.geometry = None
49        self._extension_cv_valuetriangle = []
50        self._extension_cv_thiessenvaluepolygon = []
51        self._extension_cv_valuehexagon = []
52        self._extension_cv_gridvaluecell = []
53        self._extension_cv_valuecurve = []
54        super(IF_CellValuePair, self).__init__()
55
56    @property
57    def collection(self):
58        return self._cv_surfacevaluepair.collection
59
60    @collection.setter
61    def collection(self, value):
62            self._cv_surfacevaluepair.collection = value
63
64    @property
65    def collection(self):
66        return self._cv_surfacevaluepair.collection
67
68    @collection.setter
69    def collection(self, value):
70            self._cv_surfacevaluepair.collection = value
71
72
73
74
75
76    @property
77    def extension(self):
78        return self._cv_surfacevaluepair.extension
79
80    @extension.setter
81    def extension(self, value):
82            self._cv_surfacevaluepair.extension = value
83
84    def __key(self):
85        return (self.collection, self.collection, self.value, self.geometry, self.extension)
86
87    def __eq__(x, y):
88        '''
89        Cannot compare classes which do not define a "__key" attribute
90        '''
91        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
92            return x.__key() == y.__key()
93        return id(x) == id(y)
94
95    def __hash__(self):
96        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.