initial checkin
authorClaus Gittinger <cg@exept.de>
Mon, 19 May 2008 18:12:11 +0200
changeset 2463 bfec2627f73c
parent 2462 0a33b3afa11a
child 2464 0c5915ead66f
initial checkin
BooleanBlockValue.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BooleanBlockValue.st	Mon May 19 18:12:11 2008 +0200
@@ -0,0 +1,74 @@
+"{ 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.     
+    "
+!
+
+not
+    "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.1 2008-05-19 16:12:11 cg Exp $'
+! !