2015-10-08 14:26:04 +00:00
|
|
|
|
|
|
|
#class(#pointer) Class(Apex)
|
|
|
|
{
|
|
|
|
#dcl spec selfspec superclass subclasses name instvars classvars classinstvars pooldics instmthdic classmthdic.
|
2016-05-03 10:10:28 +00:00
|
|
|
|
|
|
|
#method(#class) basicNew
|
|
|
|
{
|
|
|
|
## you must not instantiate a new class this way.
|
|
|
|
self cannotInstantiate.
|
|
|
|
}
|
|
|
|
|
|
|
|
#method(#class) initialize
|
|
|
|
{
|
|
|
|
^self.
|
|
|
|
}
|
|
|
|
|
2016-05-07 01:37:44 +00:00
|
|
|
|
|
|
|
## ########################################################################
|
|
|
|
## most of the following methods can actuall become class methods of Apex.
|
|
|
|
## ########################################################################
|
|
|
|
|
2016-05-03 10:10:28 +00:00
|
|
|
#method name
|
|
|
|
{
|
|
|
|
^self.name
|
|
|
|
}
|
|
|
|
|
|
|
|
#method superclass
|
|
|
|
{
|
|
|
|
^self.superclass
|
|
|
|
}
|
|
|
|
|
|
|
|
#method specNumInstVars
|
|
|
|
{
|
|
|
|
## shift right by 7 bits.
|
|
|
|
## see stix-prv.h for details.
|
|
|
|
^self.spec bitShift: -7
|
|
|
|
}
|
|
|
|
|
2016-05-07 01:37:44 +00:00
|
|
|
"#method inheritsFrom: aSuperclass
|
2016-05-03 10:10:28 +00:00
|
|
|
{
|
|
|
|
| c |
|
|
|
|
c := self superclass.
|
|
|
|
[c notNil] whileTrue: [
|
|
|
|
[ c == aSuperclass ] ifTrue: [^true].
|
|
|
|
c := c superclass.
|
|
|
|
].
|
|
|
|
^false
|
2016-05-07 01:37:44 +00:00
|
|
|
}"
|
2015-10-08 14:26:04 +00:00
|
|
|
}
|