Purpose:
This is an abstract class defining a function object, containing various methods used in sorting. Some examples are a function used to extract a key from an object, or to compare keys. Its primary use is by the collection class for sorting its members.
dkSort should be implemented in a subclass to provide a specific sort function. Some examples of existing implementations of sorting methods are:
Class summary:
class dkSort { public: dkSort(); virtual dkSort(); virtual DKAny getKey(const DKAny* anObject) const = 0; virtual int compare(const DKAny* first, const DKAny* second) const = 0; virtual DKBoolean lessThan(const DKAny* first, const DKAny* second) const = 0; virtual DKBoolean greaterThan(const DKAny* first, const DKAny* second) const = 0; virtual DKBoolean equals(const DKAny* first, const DKAny* second) const = 0; virtual void sort(DKAny** arrayOfAny, int arrayDimension, DKBoolean order); };
Members:
Exceptions
virtual DKAny getKey(const DKAny* anObject) const = 0;
Exceptions
virtual int compare(const DKAny* first, const DKAny* second) const = 0;
Exceptions
virtual DKBoolean lessThan(const DKAny* first, const DKAny* second) const = 0;
Exceptions
virtual DKBoolean greaterThan(const DKAny* first, const DKAny* second) const = 0;
(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.