+newReturns a new empty stack.
+new:(unsigned)nReturns a new empty stack, that can hold n objects.
-copyReturns a new copy of the stack.
-deepCopyReturns a new copy of the stack. The members in the new stack are deep copies of the members in the original stack.
-emptyYourselfRemoves all the members of the stack (without freeing them). Returns the receiver.
-freeContentsRemoves and frees all the members of the receiver, but doesn't free the receiver itself. Returns the receiver.
-freeFrees the stack, but not its contents. Returns nil. Do :
if you want to free the collection and its contents.aCltn = [[aCltn freeContents] free];
- (unsigned)depthReturns the number of objects on the stack.
- (BOOL)isEmptyWhether the number of objects on the stack is equal to zero.
-eachElementReturns a sequence of the elements in the collection.
aSeq = [myStack eachElement]; while ((anElement = [aSeq next])) { /* do something */ } aSeq = [aSeq free];
-topElementReturns the top element on the stack, without removing it. Returns nil if there are no elements on the stack.
-push:anObjectPushes anObject on the stack, so that it becomes the top of the stack. Returns self.
-popPops the top of the stack and returns it. Returns nil if the stack is empty.
-swapExchanges the top two stack items and returns the receiver. Generates an exception if the stack is not at least two items deep.
-at:(unsigned )anOffsetReturns the object at anOffset. Note that the top of the stack is at offset 0.
-removeAt:(unsigned )anOffsetRemoves the object at anOffset. Note that the top of the stack is at offset 0.
-printOn:(IOD)aFilePrints a list of the objects in the objects by sending each individual object a printOn: message. Returns the receiver.