1 | |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | from ascore.utils import has_value, collectionProofHash |
---|
22 | |
---|
23 | ''' |
---|
24 | Created on 10-Jul-2012 14:14:57 |
---|
25 | |
---|
26 | @author: mnagni |
---|
27 | ''' |
---|
28 | |
---|
29 | class OneSimplex(object): |
---|
30 | ''' |
---|
31 | Represents a data entity defined in a UML diagram and supposed to |
---|
32 | be persisted in a relational database. |
---|
33 | |
---|
34 | This class has been genererated automatically using the Apache Velocity project. |
---|
35 | ''' |
---|
36 | ''' |
---|
37 | Please note that any access to the inner attributes should be done using |
---|
38 | the given get/set methods and NOT accessing them directly. |
---|
39 | ''' |
---|
40 | def __init__(self): |
---|
41 | |
---|
42 | self.dimension = None |
---|
43 | self._vertices_eg_pointestimate = None |
---|
44 | self._vertices_gm_compositepoint = None |
---|
45 | self._vertices = None |
---|
46 | super(OneSimplex, self).__init__() |
---|
47 | @property |
---|
48 | def vertices(self): |
---|
49 | if(has_value(self._vertices_eg_pointestimate)): |
---|
50 | return self._vertices_eg_pointestimate |
---|
51 | if(has_value(self._vertices_gm_compositepoint)): |
---|
52 | return self._vertices_gm_compositepoint |
---|
53 | return None |
---|
54 | |
---|
55 | @vertices.setter |
---|
56 | def vertices(self, value): |
---|
57 | valueClass = "%s.%s" % (type(value).__module__,type(value).__name__) |
---|
58 | if valueClass == "ea_model.iso_19133_tracking_and_navigation.tracking.point_estimates.eg_pointestimate.EG_PointEstimate": |
---|
59 | self._vertices_eg_pointestimate = value |
---|
60 | self._vertices_gm_compositepoint = None |
---|
61 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_complex.gm_compositepoint.GM_CompositePoint": |
---|
62 | self._vertices_gm_compositepoint = value |
---|
63 | self._vertices_eg_pointestimate = None |
---|
64 | |
---|
65 | def synchronize(self): |
---|
66 | pass |
---|
67 | |
---|
68 | def __key(self): |
---|
69 | return (self.dimension, self.vertices) |
---|
70 | |
---|
71 | def __eq__(self, y): |
---|
72 | if type(self) != type(y): |
---|
73 | return False |
---|
74 | ''' |
---|
75 | Cannot compare classes which do not define a "__key" attribute |
---|
76 | ''' |
---|
77 | if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): |
---|
78 | return self.__key() == y.__key() |
---|
79 | return id(self) == id(y) |
---|
80 | |
---|
81 | def __hash__(self): |
---|
82 | return collectionProofHash(self.__key()) |
---|