PackageDescription: FastMerge


Fast Merge

Last published: March 12, 2007 by 'michael'

Defines 12 Classes
Extends 15 Classes


This package contains algorithms for doing a fast merge between Collections and to do partial sorts on SortedCollections.

Fast Merging:
FastMerge.CollectionIntersection new
add: #(1 3 5) asOrderedCollection;
add: #(1 2 3 4) asOrderedCollection;
add: #(3 4 5) asOrderedCollection;
results
and:
(FastMerge.CollectionUnion new)
add: #(1 3 5) asOrderedCollection;
add: #(1 2 3) asOrderedCollection;
add: #(3 4 5) asOrderedCollection;
add: #(3 4 6) asOrderedCollection;
results

Partial Sorting:
mySortedCollection sortBy: [:a :b | a <= b] from: 1 to: 10
This will sort the collection from index 1 to 10 using the new sort block.
There is also a copying version of this protocol:
newSortedCollection := mySortedCollection sortBy: [:a :b | a <= b] copyFrom: 10 to: 20.