|
Class: Boolean
Object
|
+--Boolean
|
+--False
|
+--True
- Package:
- stx:libbasic
- Category:
- Kernel-Objects
- Version:
- rev:
1.54
date: 2023/11/22 11:10:46
- user: cg
- file: Boolean.st directory: libbasic
- module: stx stc-classLibrary: libbasic
Boolean is an abstract class defining the common protocol for logical
values. The logical values are represented by its two subclasses True and False.
There are no instances of Boolean in the system and there is only one
instance of True (which is the global true) and one of False (false).
Boolean redefines some messages which deal with copying Booleans,
to make certain there is only one instance of each.
The system will behave strange if you fiddle around here and create
new instances of True or False (i.e. it will not recognize these new
instances as being true or false).
copyrightCOPYRIGHT (c) 1988 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.
Javascript support
-
js_new: argument
( an extension from the stx:libjavascript package )
-
redefined JS-new, for compatibility i.e. allow new Boolean(arg)
instance creation
-
basicNew
-
catch instance creation
- there must be exactly one instance of each - no more
-
readFrom: aStringOrStream onError: exceptionBlock
-
return a new Boolean, reading a printed representation from aStringOrStream.
Usage example(s):
Boolean readFrom:'true'
Boolean readFrom:'false'
Boolean readFrom:'xxx'
Boolean readFrom:' true'
Boolean readFrom:' false'
Boolean readFrom:'true xxx'
Boolean readFrom:'false xxx'
Boolean readFromString:'true xxx'
Boolean readFromString:'false xxx'
|
queries
-
hasSharedInstances
-
return true if this class can share instances when stored binary,
that is, instances with the same value can be stored by reference.
True returned here - there is only one true and only one false.
-
isAbstract
-
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.
-
isBuiltInClass
-
return true if this class is known by the run-time-system.
Here, true is returned (for my two subclasses).
Javascript support
-
js_asBoolean
( an extension from the stx:libjavascript package )
-
-
js_typeof
( an extension from the stx:libjavascript package )
-
return a string describing what I am
blocked
-
addDependent: someOne
-
not really an error ...
-
onChangeSend: selector to: someOne
-
It doesn't make sense to add dependents to a constant; will never change.
Silently ignore ...
converting
-
asBoolean
-
-
asBooleanValue
( an extension from the stx:libview2 package )
-
return a valueHolder for the receiver.
-
asBooleanValueWithDependent: aDependent
( an extension from the stx:libview2 package )
-
return a valueHolder for the receiver,
and make aDependent dependent of it
-
literalArrayEncoding
-
encode myself as an array literal, from which a copy of the receiver
can be reconstructed with #decodeAsLiteralArray.
copying
-
copy
-
return a shallow copy of the receiver
- since both true and false are unique, return the receiver
-
deepCopyUsing: aDictionary postCopySelector: postCopySelector
-
return a deep copy of the receiver
- since both true and false are unique, return the receiver
-
shallowCopy
-
return a shallow copy of the receiver
- since both true and false are unique, return the receiver
-
simpleDeepCopy
-
return a deep copy of the receiver
- since both true and false are unique, return the receiver
inspecting
-
inspectorValueStringInListFor: anInspector
( an extension from the stx:libtool package )
-
returns a string to be shown in the inspector's selection list
printing & storing
-
printOn: aStream
-
append a character sequence representing the receiver to the argument, aStream
-
storeOn: aStream
-
append a character sequence to the argument, aStream from which the
receiver can be reconstructed using readFrom:.
-
storeString
-
return a character sequence to the argument, aStream from which the
receiver can be reconstructed using readFrom:.
testing
-
isBoolean
-
Return true, because it is a boolean.
-
isLiteral
-
return true, if the receiver can be used as a literal constant in ST syntax
(i.e. can be used in constant arrays)
tracing
-
traceInto: aRequestor level: level from: referrer
-
double dispatch into tracer, passing my type implicitely in the selector
visiting
-
acceptVisitor: aVisitor with: aParameter
-
dispatch for visitor pattern; send #visitBoolean:with: to aVisitor
|