Important: The information in this document is obsolete and should not be used for new development.
Compare
Compares this Cyberdog item with another Cyberdog item for equality.
CDCompareType Compare (in CyberItem compare);
compare
- The
CyberItem
object to compare.- return value
- The results of the comparison. Valid return values are kCICompareLessThan, kCICompareEqual, and kCICompareGreaterThan.
DISCUSSION
This method should compare this Cyberdog item with another Cyberdog item object for equality. The superclass implementation performs an ASCII comparison of the SOM class IDs of the two Cyberdog items. In some cases, that is sufficient to distinguish between them.Therefore, the
Compare
method in aCyberItem
subclass should first call its inheritedCompare
method. If the inheritedCompare
method indicates that theCyberItem
objects are equal, then the comparison object is of the same class as the receiver. In this case, the subclass implementation should perform the additional computation necessary to establish a consistent ordering among the items.The ordering of Cyberdog items in a Cyberdog item subclass is specified by the Cyberdog item developer. For example, a developer implementing a Cyberdog item subclass might order Cyberdog items of the subclass by performing an ASCII comparison of their URL strings.
This method should define a complete ordering among all Cyberdog items of the subclass. For example, for any two Cyberdog items A and B,
A->Compare(B)
must return a result consistent with the result ofB->Compare(A)
. The ordering of Cyberdog items in a subclass should not be affected by other operations on Cyberdog items, such as opening, resolving, cloning, flattening, and unflattening.If you subclass
CyberItem
, you must override this method. Your override must call its inherited method.