22I represent a model for getters and setters
33"
44Class {
5- #name : # CBAccessorsModel ,
6- #superclass : # CBHighlightableModel ,
5+ #name : ' CBAccessorsModel' ,
6+ #superclass : ' CBHighlightableModel' ,
77 #instVars : [
88 ' accessorInvocations' ,
99 ' attributeAccess' ,
1010 ' modelType' ,
1111 ' occurrences' ,
1212 ' attribute'
1313 ],
14- #category : #' Moose-Blueprint-Models'
14+ #category : ' Moose-Blueprint-Models' ,
15+ #package : ' Moose-Blueprint-Models'
1516}
1617
17- { #category : # ' instance creation' }
18+ { #category : ' instance creation' }
1819CBAccessorsModel class >> newFrom: aMethod [
1920 ^ self new
2021 entity: aMethod;
2122 yourself
2223]
2324
24- { #category : # accessing }
25+ { #category : ' accessing' }
2526CBAccessorsModel >> accessorInvocations [
2627 ^ accessorInvocations
2728]
2829
29- { #category : # accessing }
30+ { #category : ' accessing' }
3031CBAccessorsModel >> addIncoming: anInvocation [
3132 ((accessorInvocations collect: #target ) includes: anInvocation target) ifFalse: [
3233 accessorInvocations add: anInvocation ]
3334]
3435
35- { #category : # accessing }
36+ { #category : ' accessing' }
3637CBAccessorsModel >> addOutgoing: anAttributeAccess [
3738
3839 ((attributeAccess collect: #source ) includes: anAttributeAccess source) ifFalse: [
3940 attributeAccess add: anAttributeAccess ]
4041]
4142
42- { #category : # accessing }
43+ { #category : ' accessing' }
4344CBAccessorsModel >> attributeAccess [
4445 ^ attributeAccess
4546]
4647
47- { #category : # accessing }
48+ { #category : ' accessing' }
4849CBAccessorsModel >> color [
4950
5051 " attribute isDead attribute protectors are dead "
@@ -54,26 +55,26 @@ CBAccessorsModel >> color [
5455 ifFalse: [ MiClassBlueprintPalette new colorAt: self type ]
5556]
5657
57- { #category : # initialization }
58+ { #category : ' initialization' }
5859CBAccessorsModel >> initialize [
5960
6061 super initialize.
6162 accessorInvocations := OrderedCollection new .
6263 attributeAccess := OrderedCollection new
6364]
6465
65- { #category : # testing }
66+ { #category : ' testing' }
6667CBAccessorsModel >> isCBGetter [
6768 ^ entity isCBGetter
6869]
6970
70- { #category : # testing }
71+ { #category : ' testing' }
7172CBAccessorsModel >> isDead [
7273
73- ^ self entity incomingInvocations isEmpty
74+ ^ self entity isDead
7475]
7576
76- { #category : # testing }
77+ { #category : ' testing' }
7778CBAccessorsModel >> isDeadAccessor [
7879
7980
@@ -82,59 +83,59 @@ CBAccessorsModel >> isDeadAccessor [
8283 ^ attribute isDead and : [ attribute accessors allSatisfy: #isDead ]
8384]
8485
85- { #category : # testing }
86+ { #category : ' testing' }
8687CBAccessorsModel >> isLazyInitializer [
8788 ^ self entity isLazyInitializer
8889]
8990
90- { #category : # testing }
91+ { #category : ' testing' }
9192CBAccessorsModel >> isSetter [
9293
9394 ^ entity isCBSetter
9495]
9596
96- { #category : # accessing }
97+ { #category : ' accessing' }
9798CBAccessorsModel >> modelType [
9899 ^ modelType
99100]
100101
101- { #category : # accessing }
102+ { #category : ' accessing' }
102103CBAccessorsModel >> modelType: aSymbol [
103104 modelType := aSymbol
104105]
105106
106- { #category : # accessing }
107+ { #category : ' accessing' }
107108CBAccessorsModel >> newIncomingConnection [
108109
109110 ^ CBAccessorInvocationModel new
110111 initializeDescription;
111112 yourself
112113]
113114
114- { #category : # accessing }
115+ { #category : ' accessing' }
115116CBAccessorsModel >> occurrences [
116117 ^ occurrences
117118]
118119
119- { #category : # accessing }
120+ { #category : ' accessing' }
120121CBAccessorsModel >> occurrences: aNumber [
121122 occurrences := aNumber
122123]
123124
124- { #category : # printing }
125+ { #category : ' printing' }
125126CBAccessorsModel >> printOn: aStream [
126127
127128 aStream nextPutAll: ' (' .
128129 self name asString printOn: aStream.
129130 aStream nextPutAll: ' )'
130131]
131132
132- { #category : # accessing }
133+ { #category : ' accessing' }
133134CBAccessorsModel >> protecting: anAttribte [
134135 attribute := anAttribte
135136]
136137
137- { #category : # accessing }
138+ { #category : ' accessing' }
138139CBAccessorsModel >> shape [
139140
140141 shape := RSBox new
@@ -148,7 +149,7 @@ CBAccessorsModel >> shape [
148149 ^ shape
149150]
150151
151- { #category : # accessing }
152+ { #category : ' accessing' }
152153CBAccessorsModel >> type [
153154
154155 (self entity isPureGetter or : [ self entity isSetter ]) ifTrue: [ ^ #' isSetter or isGetter' ].
0 commit comments