BooleanBlockValue.st
author Claus Gittinger <cg@exept.de>
Sat, 12 May 2018 14:23:45 +0200
changeset 4088 bbf9b58f99c8
parent 3812 18492d5d4423
permissions -rw-r--r--
#FEATURE by cg class: MIMETypes class changed: #initializeFileInfoMappings class: MIMETypes::MIMEType added: #asMimeType #isCHeaderType #isCPPSourceType #isCSourceType
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
3812
18492d5d4423 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3201
diff changeset
    14
"{ NameSpace: Smalltalk }"
18492d5d4423 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3201
diff changeset
    15
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
BlockValue subclass:#BooleanBlockValue
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Interface-Support-Models'
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
2752
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    23
!BooleanBlockValue class methodsFor:'documentation'!
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
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    26
"
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    27
 COPYRIGHT (c) 2008 by eXept Software AG
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    28
              All Rights Reserved
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    29
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    30
 This software is furnished under a license and may be used
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    31
 only in accordance with the terms of that license and with the
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    33
 be provided or otherwise made available to, or used by, any
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    34
 other person.  No title to or ownership of the software is
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    35
 hereby transferred.
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    36
"
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
    37
! !
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!BooleanBlockValue methodsFor:'logical operations'!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
& anotherBooleanValueHolder
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    "return another valueHolder, which returns the logical and of myself and another valueHolder"
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
3812
18492d5d4423 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3201
diff changeset
    44
    ^ self class 
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        forLogical:self and:anotherBooleanValueHolder
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
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 b2 a|
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
     b1 := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
     b2 := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
     a := b1 & b2.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
     b1 value:false.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
     b2 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
     b1 value:true.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
     a value.     
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    "
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
2484
d55c4fd22196 cannot use not as selector - sigh !
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
    61
logicalNot
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    "return another valueHolder, which returns the logical not of myself"
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
3812
18492d5d4423 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3201
diff changeset
    64
    ^ self class forLogicalNot:self.
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
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 nb|
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
     b := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
     nb := b not.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
     b value:true.
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
     b value:false.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
     nb value.     
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    "
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
| anotherBooleanValueHolder
3201
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
    79
    "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
    80
3812
18492d5d4423 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3201
diff changeset
    81
    ^ self class 
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
        forLogical:self or:anotherBooleanValueHolder
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
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 b2 o|
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
     b1 := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
     b2 := BooleanValueHolder new.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
     o := b1 | b2.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
     b1 value:false.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
     b2 value:false.
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
     b1 value:true.
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
     o value.     
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "
3201
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
    96
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
    97
    "Modified (comment): / 27-07-2013 / 09:54:54 / cg"
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
! !
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
!BooleanBlockValue class methodsFor:'documentation'!
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
version
3812
18492d5d4423 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3201
diff changeset
   103
    ^ '$Header$'
2752
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
   104
!
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
   105
77921bb1acbe added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
   106
version_CVS
3812
18492d5d4423 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3201
diff changeset
   107
    ^ '$Header$'
2463
bfec2627f73c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
! !
3201
e66ca008e06e class: BooleanBlockValue
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   109