Boolean.st
author claus
Thu, 10 Aug 1995 14:32:31 +0200
changeset 379 5b5a130ccd09
parent 281 d63a7d2c31a6
child 384 cc3d110ea879
permissions -rw-r--r--
revision added

"
 COPYRIGHT (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.
"

Object subclass:#Boolean
       instanceVariableNames:''
       classVariableNames:''
       poolDictionaries:''
       category:'Kernel-Objects'
!

Boolean comment:'
COPYRIGHT (c) 1988 by Claus Gittinger
	      All Rights Reserved

$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.12 1995-08-10 12:26:22 claus Exp $
'!

!Boolean class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (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.
"
!

version
"
$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.12 1995-08-10 12:26:22 claus Exp $
$Revision: 1.12 $
"
!

documentation
"
    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).
"
! !

!Boolean class methodsFor:'instance creation'!

basicNew
    "catch instance creation
     - there must be exactly one instance of each - no more"

    self error:'new instances of True/False are not allowed'
! !

!Boolean class methodsFor:'queries'!

isBuiltInClass
    "this class is known by the run-time-system"

    ^ true
! !

!Boolean methodsFor:'copying'!

copy
    "return a shallow copy of the receiver
     - since both true and false are unique, return the receiver"

    ^ self
!

shallowCopy
    "return a shallow copy of the receiver
     - since both true and false are unique, return the receiver"

    ^ self
!

deepCopy
    "return a deep copy of the receiver
     - since both true and false are unique, return the receiver"

    ^ self
!

deepCopyUsing:aDictionary
    "return a deep copy of the receiver
     - since both true and false are unique, return the receiver"

    ^ self
!

simpleDeepCopy
    "return a deep copy of the receiver
     - since both true and false are unique, return the receiver"

    ^ self
! !

!Boolean methodsFor:'queries'!

isLiteral
    "return true, if the receiver can be used as a literal
     (i.e. can be used in constant arrays)"

    ^ true
! !

!Boolean methodsFor:'printing & storing'!

printOn:aStream
    "append a character sequence representing the receiver to the argument,
     aStream"

    aStream nextPutAll:self printString
!

storeString
    "return  a character sequence to the argument, aStream from which the
     receiver can be reconstructed using readFrom:."

    ^ self printString
!

storeOn:aStream
    "append a character sequence to the argument, aStream from which the
     receiver can be reconstructed using readFrom:."

    ^ self printOn:aStream
! !

!Boolean methodsFor: 'binary storage'!

hasSpecialBinaryRepresentation
    "return true, if the receiver has a special binary representation"

	^true
! !