BooleanBlockValue.st
author Claus Gittinger <cg@exept.de>
Thu, 29 May 2008 18:19:07 +0200
changeset 2484 d55c4fd22196
parent 2463 bfec2627f73c
child 2752 77921bb1acbe
permissions -rw-r--r--
cannot use not as selector - sigh !

"{ Package: 'stx:libview2' }"

BlockValue subclass:#BooleanBlockValue
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Support-Models'
!


!BooleanBlockValue methodsFor:'logical operations'!

& anotherBooleanValueHolder
    "return another valueHolder, which returns the logical and of myself and another valueHolder"

    ^ BooleanBlockValue 
        forLogical:self and:anotherBooleanValueHolder

    "
     |b1 b2 a|

     b1 := BooleanValueHolder new.
     b2 := BooleanValueHolder new.
     a := b1 & b2.
     b1 value:false.
     b2 value:true.
     a value.      
     b1 value:true.
     a value.     
    "
!

logicalNot
    "return another valueHolder, which returns the logical not of myself"

    ^ BooleanBlockValue forLogicalNot:self.

    "
     |b nb|

     b := BooleanValueHolder new.
     nb := b not.
     b value:true.
     nb value.     
     b value:false.
     nb value.     
    "
!

| anotherBooleanValueHolder
    "return another valueHolder, which returns the logical and of myself and another valueHolder"

    ^ BooleanBlockValue 
        forLogical:self or:anotherBooleanValueHolder

    "
     |b1 b2 o|

     b1 := BooleanValueHolder new.
     b2 := BooleanValueHolder new.
     o := b1 | b2.
     b1 value:false.
     b2 value:false.
     o value.      
     b1 value:true.
     o value.     
    "
! !

!BooleanBlockValue class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview2/BooleanBlockValue.st,v 1.2 2008-05-29 16:19:07 cg Exp $'
! !