blob: 54cbb4ec54f8c833eb25602167320c0ed09cfd23 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
'''
Created on Mar 22, 2013
@author: steger
'''
from DataProcessing.DataError import DataError
#FIXME: this is a DataSource?
class Comparator(object):
'''
classdocs
'''
def __init__(self, datasource):
self._datasource = datasource
@property
def value(self):
raise DataError("Implement value property")
class IsPositive(Comparator):
'''
'''
@property
def name(self):
return "IsPositive(%s)" % self._datasource.name
@property
def value(self):
return self._datasource.value > 0
class IsNegative(Comparator):
'''
'''
@property
def name(self):
return "IsNegative(%s)" % self._datasource.name
@property
def value(self):
return self._datasource.value < 0
class IsNotPositive(Comparator):
'''
'''
@property
def name(self):
return "IsNotPositive(%s)" % self._datasource.name
@property
def value(self):
return self._datasource.value <= 0
class IsNotNegative(Comparator):
'''
'''
@property
def name(self):
return "IsNotNegative(%s)" % self._datasource.name
@property
def value(self):
return self._datasource.value >= 0
|