home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Source / MiscStack.m < prev    next >
Encoding:
Text File  |  1994-02-06  |  819 b   |  33 lines

  1. //
  2. //    MiscStack.m -- a List subclass that acts like a stack
  3. //        Written by Don Yacktman (c) 1993 by Don Yacktman.
  4. //                Version 1.1.  All rights reserved.
  5. //
  6. //        This notice may not be removed from this source code.
  7. //
  8. //    This object is included in the MiscKit by permission from the author
  9. //    and its use is governed by the MiscKit license, found in the file
  10. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  11. //    for a list of all applicable permissions and restrictions.
  12. //    
  13.  
  14. #import <misckit/MiscStack.h>
  15.  
  16. @implementation MiscStack
  17.  
  18. - pushObject:anObject
  19. {
  20.     return [self addObject:anObject]; // faster than inserting at zero
  21. }
  22.  
  23. - popObject
  24. {
  25.     return [self removeLastObject]; // faster than removing from zero
  26. }
  27.  
  28. - topObject
  29. {
  30.     return [self lastObject]; // faster than removing from zero
  31. }
  32.  
  33. @end