|
Class: Boolean
Object
|
+--Boolean
|
+--False
|
+--True
- Package:
- stx:libbasic
- Category:
- Kernel-Objects
- Version:
- rev:
1.44
date: 2015/11/18 12:17:52
- user: cg
- file: Boolean.st directory: libbasic
- module: stx stc-classLibrary: libbasic
- Author:
- Claus Gittinger
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).
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 has shared instances, that is, instances
with the same value are identical.
True returned here - there is only one true and only one false.
-
isAbstract
-
-
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 )
-
-
typeof ( an extension from the stx:libjavascript package )
-
return a string describing what I am
usage example(s):
JavaScriptParser
evaluate:'''hello''.typeof()'
JavaScriptParser
evaluate:'false.typeof();'
|
blocked
-
addDependent: someOne
-
not really an error ...
-
onChangeSend: selector to: someOne
-
not really an error ...
converting
-
asBoolean
-
-
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
|