]>
git.saurik.com Git - apple/objc4.git/blob - runtime/OldClasses.subproj/List.h
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
27 Copyright 1988-1996 NeXT Software, Inc.
29 DEFINED AS: A common class
30 HEADER FILES: objc/List.h
34 #warning The API in this header is obsoleted by NSArray.
39 #import <objc/Object.h>
41 @interface List
: Object
44 id
*dataPtr
; /* data of the List object */
45 unsigned numElements
; /* Actual number of elements */
46 unsigned maxElements
; /* Total allocated elements */
49 /* Creating, freeing */
53 - copyFromZone
:(void *)z
;
58 - initCount
:(unsigned)numSlots
;
60 /* Comparing two lists */
62 - (BOOL
)isEqual
: anObject
;
64 /* Managing the storage capacity */
67 - setAvailableCapacity
:(unsigned)numSlots
;
69 /* Manipulating objects by index */
72 - objectAt
:(unsigned)index
;
75 - insertObject
:anObject at
:(unsigned)index
;
76 - removeObjectAt
:(unsigned)index
;
78 - replaceObjectAt
:(unsigned)index with
:newObject
;
79 - appendList
: (List
*)otherList
;
81 /* Manipulating objects by id */
83 - (unsigned)indexOf
:anObject
;
84 - addObjectIfAbsent
:anObject
;
85 - removeObject
:anObject
;
86 - replaceObject
:anObject with
:newObject
;
88 /* Emptying the list */
92 /* Sending messages to elements of the list */
94 - makeObjectsPerform
:(SEL
)aSelector
;
95 - makeObjectsPerform
:(SEL
)aSelector with
:anObject
;
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.
104 + newCount
:(unsigned)numSlots
;
112 #define NX_ADDRESS(x) (((NXListId *)(x))->dataPtr)
114 #define NX_NOT_IN_LIST 0xffffffff
116 #endif /* _OBJC_LIST_H_ */