Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMMultivalueLink inherits from SequenceableCollection #65

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 11 additions & 53 deletions src/Fame-Core/FMMultivalueLink.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ that refers to it are updated accordingly.
"
Class {
#name : #FMMultivalueLink,
#superclass : #Collection,
#superclass : #SequenceableCollection,
#instVars : [
'values',
'owner',
Expand All @@ -41,6 +41,12 @@ Class {
#category : #'Fame-Core-Utilities'
}

{ #category : #'instance creation' }
FMMultivalueLink class >> new: size [

^ self new setCollection: (OrderedCollection new: size)
]

{ #category : #'instance creation' }
FMMultivalueLink class >> on: element opposite: oppositeSelector [
^ self new
Expand Down Expand Up @@ -119,50 +125,16 @@ FMMultivalueLink >> do: aBlock [
values do: aBlock
]

{ #category : #'accessing-computed' }
FMMultivalueLink >> eighth [
^ self at: 8
]

{ #category : #'accessing-computed' }
FMMultivalueLink >> fifth [
^ self at: 5
]

{ #category : #'accessing-computed' }
FMMultivalueLink >> first [
^ self at: 1
]

{ #category : #'accessing-computed' }
FMMultivalueLink >> fourth [
^ self at: 4
]

{ #category : #comparing }
FMMultivalueLink >> hash [
"From sequenceable collection"
| hash |
hash := self species hash.
1 to: self size do: [ :i | hash := (hash + (self at: i) hash) hashMultiply ].
^ hash
]

{ #category : #iterators }
FMMultivalueLink >> iterator [
^ values iterator
]

{ #category : #'accessing-computed' }
{ #category : #accessing }
FMMultivalueLink >> last [
^ values last
]

{ #category : #'accessing-computed' }
FMMultivalueLink >> ninth [
^ self at: 9
]

{ #category : #copying }
FMMultivalueLink >> postCopy [

Expand Down Expand Up @@ -190,19 +162,10 @@ FMMultivalueLink >> removeAll [
do: [ :anElement | anElement perform: opposite with: nil ]
]

{ #category : #'accessing-computed' }
FMMultivalueLink >> second [
^ self at: 2
]

{ #category : #'accessing-computed' }
FMMultivalueLink >> seventh [
^ self at: 7
]
{ #category : #initialization }
FMMultivalueLink >> setCollection: aCollection [

{ #category : #'accessing-computed' }
FMMultivalueLink >> sixth [
^ self at: 6
values := aCollection
]

{ #category : #accessing }
Expand All @@ -217,11 +180,6 @@ FMMultivalueLink >> species [
^OrderedCollection
]

{ #category : #'accessing-computed' }
FMMultivalueLink >> third [
^ self at: 3
]

{ #category : #private }
FMMultivalueLink >> unsafeAdd: element [
(values includes: element)
Expand Down
Loading