by johnmunro >> Wed, 22 Sep 2004 11:08:51 GMT
You have a collection keyed on, for example, date. You want a collection containing only the objects between two dates. Is this the quickest/most efficient way of doing it?
getMKDSubset(pMKD : MemberKeyDictionary; pAny_StartKey, pAny_EndKey : Any) : Collection final;
vars
collResults : Collection;
iter : Iterator;
obj, objStop : Object;
begin
create collResults transient;
iter := pMKD.createIterator;
pMKD.startKeyGeq(pAny_StartKey, iter);
objStop := pMKD.getAtKeyLeq(pAny_EndKey);
while iter.next(obj) and (obj <> objStop) do
coll.add(obj);
endwhile;
return collResults;
epilog
delete iter;
end;
It would be cool if there was a built in (and therefore by definition quicker) method for doing this sort of thing...
--
John Munro
FileVision UK Ltd.
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS
Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com
The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact FileVision UK Ltd. immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. FileVision UK Ltd. cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform FileVision UK Ltd.