]>
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 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
26 Copyright 1988-1996 NeXT Software, Inc.
28 DEFINED AS: A common class
29 HEADER FILES: objc/List.h
33 #warning the API in this header is obsolete
38 #import <objc/Object.h>
40 @interface List
: Object
43 id
*dataPtr
; /* data of the List object */
44 unsigned numElements
; /* Actual number of elements */
45 unsigned maxElements
; /* Total allocated elements */
48 /* Creating, freeing */
52 - copyFromZone
:(void *)z
;
57 - initCount
:(unsigned)numSlots
;
59 /* Comparing two lists */
61 - (BOOL
)isEqual
: anObject
;
63 /* Managing the storage capacity */
66 - setAvailableCapacity
:(unsigned)numSlots
;
68 /* Manipulating objects by index */
71 - objectAt
:(unsigned)index
;
74 - insertObject
:anObject at
:(unsigned)index
;
75 - removeObjectAt
:(unsigned)index
;
77 - replaceObjectAt
:(unsigned)index with
:newObject
;
78 - appendList
: (List
*)otherList
;
80 /* Manipulating objects by id */
82 - (unsigned)indexOf
:anObject
;
83 - addObjectIfAbsent
:anObject
;
84 - removeObject
:anObject
;
85 - replaceObject
:anObject with
:newObject
;
87 /* Emptying the list */
91 /* Sending messages to elements of the list */
93 - makeObjectsPerform
:(SEL
)aSelector
;
94 - makeObjectsPerform
:(SEL
)aSelector with
:anObject
;
97 * The following new... methods are now obsolete. They remain in this
98 * interface file for backward compatibility only. Use Object's alloc method
99 * and the init... methods defined in this class instead.
103 + newCount
:(unsigned)numSlots
;
111 #define NX_ADDRESS(x) (((NXListId *)(x))->dataPtr)
113 #define NX_NOT_IN_LIST 0xffffffff
115 #endif /* _OBJC_LIST_H_ */