BooleanBlockValue.st
author Claus Gittinger <cg@exept.de>
Mon, 25 Jul 2011 17:51:34 +0200
changeset 2935 c23f73a4b72e
parent 2752 77921bb1acbe
child 3201 e66ca008e06e
permissions -rw-r--r--
changed: #client:spec:builder:withMenu:

"
 COPYRIGHT (c) 2008 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libview2' }"

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

!BooleanBlockValue class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2008 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!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.3 2009-09-29 19:32:28 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/libview2/BooleanBlockValue.st,v 1.3 2009-09-29 19:32:28 cg Exp $'
! !