0
|
1 |
"{ Package: 'stx:goodies/ston' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Smalltalk }"
|
|
4 |
|
|
5 |
Object subclass:#STONReference
|
|
6 |
instanceVariableNames:'index'
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'STON-Core-Reader'
|
|
10 |
!
|
|
11 |
|
|
12 |
!STONReference class methodsFor:'instance creation'!
|
|
13 |
|
|
14 |
index: integer
|
|
15 |
^ self new
|
|
16 |
index: integer;
|
|
17 |
yourself
|
|
18 |
! !
|
|
19 |
|
|
20 |
!STONReference methodsFor:'accessing'!
|
|
21 |
|
|
22 |
index
|
|
23 |
^ index
|
|
24 |
!
|
|
25 |
|
|
26 |
index: integer
|
|
27 |
index := integer
|
|
28 |
! !
|
|
29 |
|
|
30 |
!STONReference methodsFor:'comparing'!
|
|
31 |
|
|
32 |
= anObject
|
|
33 |
^ self class == anObject class and: [ self index = anObject index ]
|
|
34 |
!
|
|
35 |
|
|
36 |
hash
|
|
37 |
^ index hash
|
|
38 |
! !
|
|
39 |
|
|
40 |
!STONReference methodsFor:'printing'!
|
|
41 |
|
|
42 |
printOn: stream
|
|
43 |
super printOn: stream.
|
|
44 |
stream nextPut: $(; print: index; nextPut: $)
|
|
45 |
! !
|
|
46 |
|
|
47 |
!STONReference methodsFor:'testing'!
|
|
48 |
|
|
49 |
isStonReference
|
|
50 |
^ true
|
|
51 |
! !
|
|
52 |
|