author | Claus Gittinger <cg@exept.de> |
Mon, 16 Feb 2009 14:22:20 +0100 | |
changeset 2601 | 5c7a21301ffe |
parent 2484 | d55c4fd22196 |
child 2752 | 77921bb1acbe |
permissions | -rw-r--r-- |
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 |
||
2484
d55c4fd22196
cannot use not as selector - sigh !
Claus Gittinger <cg@exept.de>
parents:
2463
diff
changeset
|
33 |
logicalNot |
2463 | 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 |
|
2484
d55c4fd22196
cannot use not as selector - sigh !
Claus Gittinger <cg@exept.de>
parents:
2463
diff
changeset
|
73 |
^ '$Header: /cvs/stx/stx/libview2/BooleanBlockValue.st,v 1.2 2008-05-29 16:19:07 cg Exp $' |
2463 | 74 |
! ! |