Skip to content

Commit 3ca918d

Browse files
committed
Synch 2016-08-26
1 parent ef0bacc commit 3ca918d

File tree

89 files changed

+463
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+463
-90
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
adding
1+
accessing
22
add: anAssociation
33
self privateAt: anAssociation key put: anAssociation value.
44
^ anAssociation

repository/Grease-Core.package/GROrderedMultiMap.class/instance/addAll..st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
adding
2+
"protocol: adding"
23
addAll: aDictionary
34
aDictionary keysAndValuesDo: [ :key :value |
45
self privateAt: key put: value ].
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
accessing
22
allAt: aKey
3-
^ self privateAllAt: aKey startingAt: 1
3+
^ Array streamContents: [ :stream |
4+
1 to: size do: [ :index |
5+
(keys at: index) = aKey
6+
ifTrue: [ stream nextPut: (values at: index) ] ] ]

repository/Grease-Core.package/GROrderedMultiMap.class/instance/at.add..st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
adding
1+
accessing
22
at: aKey add: aValue
33
"Add an association between aKey and aValue. Do not replace existing
44
values with the same key."

repository/Grease-Core.package/GROrderedMultiMap.class/instance/keysAndAllValuesDo..st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ enumerating
22
keysAndAllValuesDo: aTwoArgumentBlock
33
| seenKeys |
44
seenKeys := GRSmallOrderedSet new.
5-
1 to: size * 2 - 1 by: 2 do: [ :index |
5+
1 to: size do: [ :index |
66
| key |
7-
key := table at: index.
7+
key := keys at: index.
88
(seenKeys includes: key) ifFalse: [
99
aTwoArgumentBlock
1010
value: key
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
private
2-
privateAllAt: aKey startingAt: index
1+
private
2+
privateAllAt: aKey startingAt: aStartInteger
33
^ Array new: 2 streamContents: [ :stream |
4-
index to: size * 2 - 1 by: 2 do: [ :i |
5-
(table at: i) = aKey
6-
ifTrue: [ stream nextPut: (table at: i + 1) ] ] ]
4+
aStartInteger to: size do: [ :index |
5+
(keys at: index) = aKey
6+
ifTrue: [ stream nextPut: (values at: index) ] ] ]

repository/Grease-Core.package/GROrderedMultiMap.class/instance/removeKey.ifAbsent..st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
removing
1+
accessing
22
removeKey: aKey ifAbsent: aBlock
33
"Remove aKey from the receiver, evaluate aBlock if the element is missing."
44

repository/Grease-Core.package/GROrderedMultiMap.class/methodProperties.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
},
44
"instance" : {
55
"add:" : "lr 7/25/2011 19:52",
6-
"addAll:" : "pmm 8/25/2016 12:32",
7-
"allAt:" : "pmm 8/25/2016 15:09",
6+
"addAll:" : "pmm 8/26/2016 15:57",
7+
"allAt:" : "jf 2/15/2010 15:39",
88
"allAt:ifAbsent:" : "jf 2/15/2010 15:39",
99
"at:add:" : "jf 2/15/2010 13:24",
10-
"keysAndAllValuesDo:" : "pmm 8/25/2016 15:12",
11-
"privateAllAt:startingAt:" : "pmm 8/25/2016 15:08",
12-
"removeKey:ifAbsent:" : "pmm 8/22/2016 12:10" } }
10+
"keysAndAllValuesDo:" : "pmm 8/26/2016 15:52",
11+
"privateAllAt:startingAt:" : "pmm 8/26/2016 15:52",
12+
"removeKey:ifAbsent:" : "pmm 8/26/2016 15:56" } }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
I am an implementation of an ordered multi-map. I allow multiple values to be associated with the same key and maintain the order of addition. #at: and its derivatives all operate on the first matching key, while #allAt: returns the complete list of values for a key in the order they were added.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
adding
2+
add: anAssociation
3+
self privateAt: anAssociation key put: anAssociation value.
4+
^ anAssociation

0 commit comments

Comments
 (0)