• Keine Ergebnisse gefunden

Common Classes and Functions

Im Dokument Oriented Software (Seite 188-194)

Classes

HashTable

Inherits From: Object

Initializing and Freeing a HashTable -init

- initKeyDesc:(const char *)aKeyDesc - initKeyDesc:(const char *)aKeyDesc

valueDesc:(const char *)aValueDesc - initKeyDesc:(const char *)aKeyDesc

valueDesc:(const char *)aValueDesc capacity:(unsigned int)aCapacity -free

- freeObjects

- freeKeys:(void (*)(void *»keyFunc values:(void (*)(void *»valueFunc -empty

Copying a HashTable

- copyFromZone:(NXZone *) zone

Initializes a new, default HashTable Initializes a new HashTable Initializes a new HashTable Initializes a new HashTable

Deallocates the HashTable

Deallocates the HashTable's objects

Conditionally frees the HashTable's associations Empties the HashTable but retains its capacity

Returns an empty copy of the HashTable

Classes: HashTable 3-1

Manipulating Table Associations - (unsigned int)count

- (BOOL)isKey:(const void *)aKey - (void *)valueForKey:(const void *)aKey - (void *)insertKey:(const void *)aKey

value:(void *)aValue

- (void *)removeKey:(const void *)aKey Iterating Over All Associations

- (NXHashState )initState

- (BOOL)nextState:(NXHashState *)aState key:(const void **)aKey

value:(void **)aValue Archiving

- read:(NXTypedStream *)stream - write:(NXTypedStream *)stream

List

Inherits From: Object Initializing a New List Object

- init

- initCount:(unsigned int)numSlots Copying and Freeing a List

- copyFromZone:(NXZone *)zone -free

Manipulating Objects by Index

- insertObject:anObject at: (unsigned int)index

Returns the number of objects in the table Indicates whether aKey is in the table Returns the value mapped to aKey Adds or updates akeylavalue pair Removes akeylavalue pair

Begins process of iteration through the HashTable Moves to the next entry in the HashTable

Read the HashTable from the typed stream stream Writes the HashTable to the typed stream stream

Initializes the new List object

Initializes the new List to hold at least numSlots objects

Returns a copy of the List allocated from zone Deallocates the List object

Puts anObject in the List at index

- addObject:anObject

- removeObjectAt:(unsigned int)index - removeLastObject

- replaceObjectAt:(unsigned int)index with:newObject

- objectAt:(unsigned int)index -lastObject

- (unsigned int)count Manipulating Objects by id

- addObject:anObject

- addObjectIfAbsent:anObject - removeObject:anObject

- replaceObject:anObject with:newObject - (unsigned int)indexOf:anObject

Comparing and Combining Lists - (BOOL)isEqual:anObject - appendList:(List *)otherList Emptying a List

-empty - freeObjects

Sending Messages to the Objects - makeObjectsPerform:(SEL)aSelector - makeObjectsPerform:(SEL)aSelector

with:anObject

Managing the Storage Capacity - (unsigned int)capacity

- setAvailableCapacity:(unsigned int)numSlots Archiving

- write:(NXTypedStream *)stream - read:(NXTypedStream *)stream

Adds anObject at the end of the List Removes the object located at index Removes the object at the end of the List Puts newObject in place of the object at index Returns the object at index

Returns the object at the end of the List Returns the number of objects in the List

Adds anObject at the end of the List

Adds anObject to the List, if it's not already in the List Removes first occurrence of anObject from the List Puts newObject in the List in place of anObject Returns the index of anObject

Returns whether the two Lists have the same contents Adds the objects in otherList to the receiving List

Empties the List of its contents, but doesn't free the objects Deallocates all the objects in the List

Sends an aSelector message to each object in the List Sends aSelector message with an argument to each object

Returns the number of objects the List can store Sets the capacity of the List to at least numSlots objects

Writes the List to the typed stream stream Reads the List from the typed stream stream

Classes: List 3-3

NXBundle

Inherits From: Object

Initializing a New NXBundle object - initForDirectory:(const char *)fullPath

Getting and Freeing an NXBundle + mainBundle

+ bundleForClass:classObject -free

Getting a Bundled Class - principal Class

- c1assNamed:(const char *)classname Setting Which Resources To Use

Initializes a new object for the fullPath directory

Returns the NXBundle for the directory of the executable Returns the NXBundle that loaded classObject

Frees the receiving NXBundle, if it can be freed

Returns the principal class loaded by the receiver Returns the class object for the classname class

+ setSystemLanguages:(const char * const *)languageArray

Finding a Resource

- (BOOL)getPath:(char *)path

forResource:(const char *)filename of'Type:(const char *)extension + (BOOL)getPath:(char *)path

forResource:(const char *)filename of'Type:(const char *)extension inDirectory:(const char *)directory with Version: (int)version

Getting the Bundle Directory - (const char *)directory

Informs the receiver of the user's language preferences

Provides the full path to the filename resource

Provides the full path to the filename resource

. Returns the full pathname of the NXBundle's directory

Setting the Version - setVersion:(int)version - (int)version

NXStringTable

Inherits From: HashTable : Object Initializing and Freeing an NXStringTable

-init -free

Querying an NXStringTable

Sets the version that resources must match Returns the version that resources must match

Initializes a new NXStringTable Deallocates the NXStringTable

- (const char *)valueForStringKey:(const char *)aString

Writing Elements

- readFromFile:(const char *)fileName - writeToFile:(const char *)fileName - readFromStream:(NXStream *)stream - writeToStream:(NXStream *)stream

Storage

Inherits From: Object Initializing a New Storage Object

- init

Returns the value that corresponds to aString

Reads the keys and values from fileName Writes the keys and values to fileName Reads the keys and values from stream Writes the keys and values to stream

Initializes the Storage object

Classes: NXStringTable 3-5

- initCount:(unsigned int)count

elementSize:(unsigned int)sizelnBytes description:( const char *)descriptor Copying and Freeing Storage Objects

- copyFromZone:(NXZone *)zone -free

Getting, Adding, and Removing Elements - addElement:(void *)anElement

- insertElement:(void *)anElement at:(unsigned int)index

- removeElementAt:(unsigned int)index - removeLastElement

- replaceElementAt:(unsigned int)index with:(void *)anElement

-empty

- (void *)elementAt:(unsigned int)index Comparing Storage Objects

- (BOOL)isEqual:anObject

Managing the Storage Capacity and Type - (unsigned int)count

- (const char *)description

- setAvailableCapacity:(unsigned int)numSlots - setNumSlots:(unsigned int)numSlots

Archiving

- read:(NXTypedStream *)stream - write:(NXTypedStream *)stream

Initializes the new object to store at least count elements

Returns a copy of the Storage object allocated from zone Deallocates the Storage object and its contents

Adds anElement at the end of the Storage array Puts anElement in the Storage array at index Removes the element located at index Removes the last element

Replaces the element at index with anElement Empties the Storage object but retains its capacity Returns a pointer to the element at index

Returns whether two Storage objects are the same

Returns the number of elements currently stored Returns the encoding for the type of elements stored Sets the capacity of the Storage array to at least numSlots Sets the number of elements stored to numSlots elements

Reads the Storage object from the typed stream stream Writes the Storage object to the typed stream stream

Functions

Im Dokument Oriented Software (Seite 188-194)