-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Extension { #name : #Array } | ||
|
||
{ #category : #'*Collections-Homogeneous' } | ||
Array class >> of: elementSpecies [ | ||
| mc c | | ||
mc := HomogeneousArray class copy. | ||
c := mc new | ||
superclass: HomogeneousArray superclass | ||
methodDictionary: HomogeneousArray methodDictionary | ||
format: HomogeneousArray format; | ||
setName: 'Array of: ', elementSpecies name; | ||
instVarNamed: #elementSpecies put: elementSpecies; | ||
yourself. | ||
^c | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Extension { #name : #Class } | ||
|
||
{ #category : #'*Collections-Homogeneous' } | ||
Class >> array [ | ||
^Array of: self | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Extension { #name : #Collection } | ||
|
||
{ #category : #'*Collections-Homogeneous' } | ||
Collection >> isHomogeneous [ | ||
^false | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Class { | ||
#name : #HomogeneousArray, | ||
#superclass : #Array, | ||
#type : #variable, | ||
#classInstVars : [ | ||
'elementSpecies' | ||
], | ||
#category : #'Collections-Homogeneous' | ||
} | ||
|
||
{ #category : #accessing } | ||
HomogeneousArray class >> elementSpecies [ | ||
^elementSpecies | ||
] | ||
|
||
{ #category : #JSON } | ||
HomogeneousArray class >> neoJsonMapping: mapper [ | ||
mapper for: self customDo: [ :mapping | | ||
mapping listOfElementSchema: elementSpecies | ||
] | ||
] | ||
|
||
{ #category : #testing } | ||
HomogeneousArray >> isHomogeneous [ | ||
^true | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : #'Collections-Homogeneous' } |