List.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
00003  *
00004  * @APPLE_LICENSE_HEADER_START@
00005  * 
00006  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
00007  * Reserved.  This file contains Original Code and/or Modifications of
00008  * Original Code as defined in and that are subject to the Apple Public
00009  * Source License Version 1.1 (the "License").  You may not use this file
00010  * except in compliance with the License.  Please obtain a copy of the
00011  * License at http://www.apple.com/publicsource and read it before using
00012  * this file.
00013  * 
00014  * The Original Code and all software distributed under the License are
00015  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
00016  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
00017  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
00018  * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
00019  * License for the specific language governing rights and limitations
00020  * under the License.
00021  * 
00022  * @APPLE_LICENSE_HEADER_END@
00023  */
00024 /*
00025     List.h
00026     Copyright 1988-1996 NeXT Software, Inc.
00027 
00028     DEFINED AS: A common class
00029     HEADER FILES:   objc/List.h
00030 
00031 */
00032 
00033 #warning The API in this header is obsoleted by NSArray.
00034 
00035 #ifndef _OBJC_LIST_H_
00036 #define _OBJC_LIST_H_
00037 
00038 #import <objc/Object.h>
00039 
00040 @interface List : Object
00041 {
00042 @public
00043     id      *dataPtr;   /* data of the List object */
00044     unsigned    numElements;    /* Actual number of elements */
00045     unsigned    maxElements;    /* Total allocated elements */
00046 }
00047 
00048 /* Creating, freeing */
00049 
00050 - free;
00051 - freeObjects;
00052 - copyFromZone:(void *)z;
00053   
00054 /* Initializing */
00055 
00056 - init;
00057 - initCount:(unsigned)numSlots;
00058 
00059 /* Comparing two lists */
00060 
00061 - (BOOL)isEqual: anObject;
00062   
00063 /* Managing the storage capacity */
00064 
00065 - (unsigned)capacity;
00066 - setAvailableCapacity:(unsigned)numSlots;
00067 
00068 /* Manipulating objects by index */
00069 
00070 - (unsigned)count;
00071 - objectAt:(unsigned)index;
00072 - lastObject;
00073 - addObject:anObject;
00074 - insertObject:anObject at:(unsigned)index;
00075 - removeObjectAt:(unsigned)index;
00076 - removeLastObject;
00077 - replaceObjectAt:(unsigned)index with:newObject;
00078 - appendList: (List *)otherList;
00079 
00080 /* Manipulating objects by id */
00081 
00082 - (unsigned)indexOf:anObject;
00083 - addObjectIfAbsent:anObject;
00084 - removeObject:anObject;
00085 - replaceObject:anObject with:newObject;
00086 
00087 /* Emptying the list */
00088 
00089 - empty;
00090 
00091 /* Sending messages to elements of the list */
00092 
00093 - makeObjectsPerform:(SEL)aSelector;
00094 - makeObjectsPerform:(SEL)aSelector with:anObject;
00095 
00096 /*
00097  * The following new... methods are now obsolete.  They remain in this 
00098  * interface file for backward compatibility only.  Use Object's alloc method 
00099  * and the init... methods defined in this class instead.
00100  */
00101 
00102 + new;
00103 + newCount:(unsigned)numSlots;
00104 
00105 @end
00106 
00107 typedef struct {
00108     @defs(List)
00109 } NXListId;
00110 
00111 #define NX_ADDRESS(x) (((NXListId *)(x))->dataPtr)
00112 
00113 #define NX_NOT_IN_LIST  0xffffffff
00114 
00115 #endif /* _OBJC_LIST_H_ */

Generated on Tue Sep 19 21:18:24 2006 for Boomerang by  doxygen 1.4.6