FunkySortingBucket
@interface FunkySortingBucket : NSObject
This is a data structure representing a bucket of items when bucket-sorting
See
Sorting method+[FunkySort comparatorWithBuckets:]
See
Sorting method with custom default comparator+[FunkySort comparatorWithBuckets:defaultInnerBucketComparator:]
-
The filter to determine whether an item is belonging to the current bucket
Declaration
Objective-C
@property (readwrite, copy, nonatomic) FunkySortingBucketFilterBlock filterBlock;
-
A comparator to use inside the elements in this bucket
Declaration
Objective-C
@property (readwrite, copy, nonatomic) NSComparator innerBucketComparator;
Swift
var innerBucketComparator: Comparator! { get set }
-
Creates a new bucket by initialising the
filterBlock
with the given parameter to determine whether an item is belonging to the bucketDeclaration
Objective-C
+ (instancetype)bucketWithBlock:(FunkySortingBucketFilterBlock)block;
Swift
convenience init!(block: Any!)
Return Value
A new (specific) bucket
-
Creates a new bucket by leaving the
filterBlock
nil, to collect all the remaining items which did not fit into the specific buckets. You can only hold one collector bucket in one bucket-filtering operationSee
Getter for determining whether the current bucket is a collector-[FunkySortingBucket isCollectorBucket]
Declaration
Objective-C
+ (instancetype)bucketWithAllTheRest;
Swift
class func withAllTheRest() -> Self!
Return Value
A new collector bucket, holding all the other items which did not fit into specific buckets.
-
The filter to determine whether an item is belonging to the current bucket
Declaration
Objective-C
- (BOOL)isCollectorBucket;
Swift
func isCollectorBucket() -> Bool
Return Value
YES of the bucket is initialised with nil
filterBlock
value, meaning that this is a special bucket used for storing the remaining elements