mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-11 10:38:00 +08:00
Initial commit
This commit is contained in:
30
ReactKit/Base/RCTSparseArray.h
Normal file
30
ReactKit/Base/RCTSparseArray.h
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface RCTSparseArray : NSObject <NSCopying>
|
||||
|
||||
- (instancetype)init;
|
||||
- (instancetype)initWithCapacity:(NSUInteger)capacity;
|
||||
- (instancetype)initWithSparseArray:(RCTSparseArray *)sparseArray;
|
||||
|
||||
+ (instancetype)sparseArray;
|
||||
+ (instancetype)sparseArrayWithCapacity:(NSUInteger)capacity;
|
||||
+ (instancetype)sparseArrayWithSparseArray:(RCTSparseArray *)sparseArray;
|
||||
|
||||
// Use nil object to remove at idx.
|
||||
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx;
|
||||
- (id)objectAtIndexedSubscript:(NSUInteger)idx;
|
||||
|
||||
// Use nil obj to remove at key.
|
||||
- (void)setObject:(id)obj forKeyedSubscript:(NSNumber *)key;
|
||||
- (id)objectForKeyedSubscript:(NSNumber *)key;
|
||||
|
||||
@property (readonly, nonatomic) NSUInteger count;
|
||||
@property (readonly, nonatomic, copy) NSArray *allIndexes;
|
||||
@property (readonly, nonatomic, copy) NSArray *allObjects;
|
||||
|
||||
- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block;
|
||||
- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block;
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user