BooleanBlockValue.st
author sr
Thu, 26 Nov 2015 17:20:45 +0100
changeset 3527 aa939bace1e9
parent 3201 e66ca008e06e
child 3812 18492d5d4423
permissions -rw-r--r--
#OTHER class: ApplicationModel changed: #enqueueMessage:for:arguments:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2752
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
     1
"
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
     2
 COPYRIGHT (c) 2008 by eXept Software AG
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
     3
              All Rights Reserved
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
     4
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
     5
 This software is furnished under a license and may be used
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
     6
 only in accordance with the terms of that license and with the
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
     8
 be provided or otherwise made available to, or used by, any
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
     9
 other person.  No title to or ownership of the software is
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    10
 hereby transferred.
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    11
"
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libview2' }"
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
BlockValue subclass:#BooleanBlockValue
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Interface-Support-Models'
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
2752
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    21
!BooleanBlockValue class methodsFor:'documentation'!
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    22
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    23
copyright
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    24
"
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    25
 COPYRIGHT (c) 2008 by eXept Software AG
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    26
              All Rights Reserved
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    27
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    28
 This software is furnished under a license and may be used
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    29
 only in accordance with the terms of that license and with the
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    31
 be provided or otherwise made available to, or used by, any
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    32
 other person.  No title to or ownership of the software is
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    33
 hereby transferred.
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    34
"
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    35
! !
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!BooleanBlockValue methodsFor:'logical operations'!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
& anotherBooleanValueHolder
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    "return another valueHolder, which returns the logical and of myself and another valueHolder"
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    ^ BooleanBlockValue 
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
        forLogical:self and:anotherBooleanValueHolder
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    "
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
     |b1 b2 a|
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
     b1 := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
     b2 := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
     a := b1 & b2.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
     b1 value:false.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
     b2 value:true.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
     a value.      
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
     b1 value:true.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
     a value.     
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    "
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
2484
d55c4fd22196 cannot use not as selector - sigh !
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
    59
logicalNot
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    "return another valueHolder, which returns the logical not of myself"
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    ^ BooleanBlockValue forLogicalNot:self.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
     |b nb|
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
     b := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
     nb := b not.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
     b value:true.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
     nb value.     
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
     b value:false.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
     nb value.     
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    "
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
| anotherBooleanValueHolder
3201
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
    77
    "return another valueHolder, which returns the logical or of myself and another valueHolder"
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    ^ BooleanBlockValue 
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
        forLogical:self or:anotherBooleanValueHolder
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    "
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
     |b1 b2 o|
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
     b1 := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
     b2 := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
     o := b1 | b2.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
     b1 value:false.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
     b2 value:false.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
     o value.      
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
     b1 value:true.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
     o value.     
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    "
3201
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
    94
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
    95
    "Modified (comment): / 27-07-2013 / 09:54:54 / cg"
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
! !
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
!BooleanBlockValue class methodsFor:'documentation'!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
version
3201
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   101
    ^ '$Header: /cvs/stx/stx/libview2/BooleanBlockValue.st,v 1.4 2013-07-27 08:09:59 cg Exp $'
2752
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
   102
!
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
   103
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
   104
version_CVS
3201
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   105
    ^ '$Header: /cvs/stx/stx/libview2/BooleanBlockValue.st,v 1.4 2013-07-27 08:09:59 cg Exp $'
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
! !
3201
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   107