
#import "SortedList.h"

@implementation SortedList

- addObjectSorted:anObject;
{
	id otherObject;
	int i=0;
	
	while(TRUE)
	{
		otherObject = [self objectAt:i];

		if (!otherObject)
			return [self addObject:anObject];

		if ([anObject compareWith:otherObject] < 0)
			return [self insertObject:anObject at:i];
		
		i++;
	}
}

@end
