|
Class: BooleanValueHolder
Object
|
+--Model
|
+--ValueModel
|
+--ValueHolder
|
+--BooleanValueHolder
- Package:
- stx:libview2
- Category:
- Interface-Support-Models
- Version:
- rev:
1.5
date: 2021/01/20 14:36:43
- user: cg
- file: BooleanValueHolder.st directory: libview2
- module: stx stc-classLibrary: libview2
a valueHolder holding a boolean.
Mostly for documentation purposes and the assertion, that only boolean values
are held. Also provides convenient logical operations.
copyrightCOPYRIGHT (c) 2008 by Claus Gittinger
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.
instance creation
-
new
-
return a new BooleanValueHolder holding false as initial value
accessing
-
setValue: aBoolean
-
(comment from inherited method)
set my value without notification.
logical operations
-
& anotherBooleanValueHolder
-
return another valueHolder, which returns the logical and of myself and another valueHolder
Usage example(s):
|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
-
| anotherBooleanValueHolder
-
return another valueHolder, which returns the logical or of myself and another valueHolder
Usage example(s):
|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.
|
|b nb|
b := BooleanValueHolder new.
nb := b not.
b value:true.
nb value.
b value:false.
nb value.
|
|