PATH  WebObjects 4.0 Documentation > EOControl Reference



EOSortOrdering.Comparison

Implemented By:
EONullValue (Java Client)
NSObject (Yellow Box)

Package:
com.apple.client.eocontrol (Java Client)

Interface Description

The EOSortOrdering.Comparison interface defines methods for comparing values. These methods are used for sorting value objects. Though declared for NSObject in Yellow Box, most of these methods work properly only with value classes: NSString, NSDate, NSNumber, NSDecimalNumber, and EONullValue. Yellow Box implements these methods as part of NSObject-there is no separate interface. In Java Client, support for these methods is provided for java.lang.String, java.lang.Number, and java.lang.Date using EOSortOrdering.ComparisonSupport. EONullValue implements the interface directly. You should implement this interface for any value classes you write that you want to be properly sorted by EOSortOrdering instances.

Sorting value objects
- compareAscending
- compareCaseInsensitiveAscending
- compareCaseInsensitiveDescending
- compareDescending

Instance Methods


compareAscending

public abstract int compareAscending (java.lang.Object anObject)

Returns NSOrderedAscending if anObject is naturally ordered after the receiver, NSOrderedDescending if it's naturally ordered before the receiver, and NSOrderedSame if they're equivalent for ordering purposes. NSObject's implementation of this method simply invokes compare .

See also: - compareDescending , - compareCaseInsensitiveAscending , - compareCaseInsensitiveDescending


compareCaseInsensitiveAscending

public abstract int compareCaseInsensitiveAscending (java.lang.Object anObject)

Returns NSOrderedAscending if anObject is naturally ordered-ignoring case-after the receiver, NSOrderedDescending if it's naturally ordered before the receiver, and NSOrderedSame if they're equivalent for ordering purposes. NSObject's implementation of this method invokes compare , while NSString's invokes caseInsensitiveCompare .

See also: - compareCaseInsensitiveDescending , - compareAscending , - compareDescending


compareCaseInsensitiveDescending

public abstract int compareCaseInsensitiveDescending (java.lang.Object anObject)

Returns NSOrderedAscending if anObject is naturally ordered-ignoring case-before the receiver, NSOrderedDescending if it's naturally ordered after the receiver, and NSOrderedSame if they're equivalent for ordering purposes. NSObject's implementation of this method invokes compare and inverts the result, while NSString's invokes caseInsensitiveCompare and inverts the result.

See also: - compareCaseInsensitiveAscending , - compareDescending , - compareAscending


compareDescending

public abstract int compareDescending (java.lang.Object anObject)

Returns NSOrderedAscending if anObject is naturally ordered before the receiver, NSOrderedDescending if it's naturally ordered after the receiver, and NSOrderedSame if they're equivalent for ordering purposes. NSObject's implementation of this method simply invokes compare and inverts the result.

See also: - compareAscending , - compareCaseInsensitiveDescending , - compareCaseInsensitiveAscending





Copyright © 1998, Apple Computer, Inc. All rights reserved.