source: mauRepo/MolesManager/trunk/src/ea_model/iso_19123_2005_coverages/coverages/segmented_curve/cv_valuesegment.py @ 8087

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19123_2005_coverages/coverages/segmented_curve/cv_valuesegment.py@8087
Revision 8087, 1.3 KB checked in by mnagni, 8 years ago (diff)

Imported a new DB library which fixes the MO_ObservationColleciton <--> CEDA_ObservationCollection problem

Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18from ascore.utils import has_value
19
20'''
21Created on 06-Feb-2012 15:59:39
22
23@author: mnagni
24'''
25
26class CV_ValueSegment(object):
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
39        self.startParameter = None
40        self.endParameter = None
41        self.curve = []
42        self.endValue = None
43        self.startValue = None
44        self.ends = None
45        super(CV_ValueSegment, self).__init__()
46
47
48
49
50
51
52
53
54
55
56
57
58
59    def __key(self):
60        return (self.startParameter, self.endParameter, self.curve, self.endValue, self.startValue, self.ends)
61
62    def __eq__(x, y):
63        '''
64        Cannot compare classes which do not define a "__key" attribute
65        '''
66        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
67            return x.__key() == y.__key()
68        return id(x) == id(y)
69
70    def __hash__(self):
71        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.