2 * Copyright (c) 1999-2002, 2005-2007 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
25 Copyright 1988-1996 NeXT Software, Inc.
27 DEFINED AS: A common class
28 HEADER FILES: objc/List.h
35 #if __OBJC__ && !__OBJC2__ && !__cplusplus && !__has_feature(objc_arc)
37 #include <objc/Object.h>
38 #include <Availability.h>
41 @interface List
: Object
44 id
*dataPtr DEPRECATED_ATTRIBUTE
; /* data of the List object */
45 unsigned numElements DEPRECATED_ATTRIBUTE
; /* Actual number of elements */
46 unsigned maxElements DEPRECATED_ATTRIBUTE
; /* Total allocated elements */
49 /* Creating, freeing */
51 - (id
)free DEPRECATED_ATTRIBUTE
;
52 - (id
)freeObjects DEPRECATED_ATTRIBUTE
;
53 - (id
)copyFromZone
:(void *)z DEPRECATED_ATTRIBUTE
;
57 - (id
)init DEPRECATED_ATTRIBUTE
;
58 - (id
)initCount
:(unsigned)numSlots DEPRECATED_ATTRIBUTE
;
60 /* Comparing two lists */
62 - (BOOL
)isEqual
: anObject DEPRECATED_ATTRIBUTE
;
64 /* Managing the storage capacity */
66 - (unsigned)capacity DEPRECATED_ATTRIBUTE
;
67 - (id
)setAvailableCapacity
:(unsigned)numSlots DEPRECATED_ATTRIBUTE
;
69 /* Manipulating objects by index */
71 - (unsigned)count DEPRECATED_ATTRIBUTE
;
72 - (id
)objectAt
:(unsigned)index DEPRECATED_ATTRIBUTE
;
73 - (id
)lastObject DEPRECATED_ATTRIBUTE
;
74 - (id
)addObject
:anObject DEPRECATED_ATTRIBUTE
;
75 - (id
)insertObject
:anObject at
:(unsigned)index DEPRECATED_ATTRIBUTE
;
76 - (id
)removeObjectAt
:(unsigned)index DEPRECATED_ATTRIBUTE
;
77 - (id
)removeLastObject DEPRECATED_ATTRIBUTE
;
78 - (id
)replaceObjectAt
:(unsigned)index with
:newObject DEPRECATED_ATTRIBUTE
;
79 - (id
)appendList
: (List
*)otherList DEPRECATED_ATTRIBUTE
;
81 /* Manipulating objects by id */
83 - (unsigned)indexOf
:anObject DEPRECATED_ATTRIBUTE
;
84 - (id
)addObjectIfAbsent
:anObject DEPRECATED_ATTRIBUTE
;
85 - (id
)removeObject
:anObject DEPRECATED_ATTRIBUTE
;
86 - (id
)replaceObject
:anObject with
:newObject DEPRECATED_ATTRIBUTE
;
88 /* Emptying the list */
90 - (id
)empty DEPRECATED_ATTRIBUTE
;
92 /* Sending messages to elements of the list */
94 - (id
)makeObjectsPerform
:(SEL
)aSelector DEPRECATED_ATTRIBUTE
;
95 - (id
)makeObjectsPerform
:(SEL
)aSelector with
:anObject DEPRECATED_ATTRIBUTE
;
98 * The following new... methods are now obsolete. They remain in this
99 * interface file for backward compatibility only. Use Object's alloc method
100 * and the init... methods defined in this class instead.
103 + (id
)new DEPRECATED_ATTRIBUTE
;
104 + (id
)newCount
:(unsigned)numSlots DEPRECATED_ATTRIBUTE
;
110 } NXListId DEPRECATED_ATTRIBUTE
;
112 #define NX_ADDRESS(x) (((NXListId *)(x))->dataPtr)
114 #define NX_NOT_IN_LIST 0xffffffff
118 #endif /* _OBJC_LIST_H_ */