2463
|
1 |
"{ Package: 'stx:libview2' }"
|
|
2 |
|
|
3 |
BlockValue subclass:#BooleanBlockValue
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Interface-Support-Models'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!BooleanBlockValue methodsFor:'logical operations'!
|
|
12 |
|
|
13 |
& anotherBooleanValueHolder
|
|
14 |
"return another valueHolder, which returns the logical and of myself and another valueHolder"
|
|
15 |
|
|
16 |
^ BooleanBlockValue
|
|
17 |
forLogical:self and:anotherBooleanValueHolder
|
|
18 |
|
|
19 |
"
|
|
20 |
|b1 b2 a|
|
|
21 |
|
|
22 |
b1 := BooleanValueHolder new.
|
|
23 |
b2 := BooleanValueHolder new.
|
|
24 |
a := b1 & b2.
|
|
25 |
b1 value:false.
|
|
26 |
b2 value:true.
|
|
27 |
a value.
|
|
28 |
b1 value:true.
|
|
29 |
a value.
|
|
30 |
"
|
|
31 |
!
|
|
32 |
|
|
33 |
not
|
|
34 |
"return another valueHolder, which returns the logical not of myself"
|
|
35 |
|
|
36 |
^ BooleanBlockValue forLogicalNot:self.
|
|
37 |
|
|
38 |
"
|
|
39 |
|b nb|
|
|
40 |
|
|
41 |
b := BooleanValueHolder new.
|
|
42 |
nb := b not.
|
|
43 |
b value:true.
|
|
44 |
nb value.
|
|
45 |
b value:false.
|
|
46 |
nb value.
|
|
47 |
"
|
|
48 |
!
|
|
49 |
|
|
50 |
| anotherBooleanValueHolder
|
|
51 |
"return another valueHolder, which returns the logical and of myself and another valueHolder"
|
|
52 |
|
|
53 |
^ BooleanBlockValue
|
|
54 |
forLogical:self or:anotherBooleanValueHolder
|
|
55 |
|
|
56 |
"
|
|
57 |
|b1 b2 o|
|
|
58 |
|
|
59 |
b1 := BooleanValueHolder new.
|
|
60 |
b2 := BooleanValueHolder new.
|
|
61 |
o := b1 | b2.
|
|
62 |
b1 value:false.
|
|
63 |
b2 value:false.
|
|
64 |
o value.
|
|
65 |
b1 value:true.
|
|
66 |
o value.
|
|
67 |
"
|
|
68 |
! !
|
|
69 |
|
|
70 |
!BooleanBlockValue class methodsFor:'documentation'!
|
|
71 |
|
|
72 |
version
|
|
73 |
^ '$Header: /cvs/stx/stx/libview2/BooleanBlockValue.st,v 1.1 2008-05-19 16:12:11 cg Exp $'
|
|
74 |
! !
|