equal
deleted
inserted
replaced
1614 ! |
1614 ! |
1615 |
1615 |
1616 asArrayOfType:arrayClass |
1616 asArrayOfType:arrayClass |
1617 "return a new instance of arrayClass with the collection's elements" |
1617 "return a new instance of arrayClass with the collection's elements" |
1618 |
1618 |
1619 |anIntegerArray |
1619 |anArrayInstance |
1620 index "{ Class: SmallInteger }" | |
1620 index "{ Class: SmallInteger }" | |
1621 |
1621 |
1622 anIntegerArray := arrayClass new:(self size). |
1622 anArrayInstance := arrayClass new:(self size). |
1623 index := 1. |
1623 index := 1. |
1624 self do:[:each | |
1624 self do:[:each | |
1625 anIntegerArray at:index put:each. |
1625 anArrayInstance at:index put:each. |
1626 index := index + 1 |
1626 index := index + 1 |
1627 ]. |
1627 ]. |
1628 ^ anIntegerArray |
1628 ^ anArrayInstance |
1629 ! |
1629 ! |
1630 |
1630 |
1631 asBag |
1631 asBag |
1632 "return a new Bag with the receiver collection's elements" |
1632 "return a new Bag with the receiver collection's elements" |
1633 |
1633 |