BooleanBlockValue.st
author Claus Gittinger <cg@exept.de>
Wed, 06 May 2009 09:29:31 +0200
changeset 2633 90276ef2f5fc
parent 2484 d55c4fd22196
child 2752 77921bb1acbe
permissions -rw-r--r--
initial checkin

"{ 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 $'
! !