home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / komix / DATA.Z / cbclasssta.tcl < prev    next >
Text File  |  1996-05-29  |  1KB  |  56 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Westmount Technology    1994
  4. #
  5. #      File:           @(#)cbclasssta.tcl    1.2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)cbclasssta.tcl    1.2   28 Jul 1995 Copyright 1994 Westmount Technology
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14.  
  15. Class CBClassStack : {GCObject} {
  16.     constructor
  17.     method destructor
  18.     method push
  19.     method pop
  20.     method size
  21.     attribute classList
  22. }
  23.  
  24. constructor CBClassStack {class this} {
  25.     set this [GCObject::constructor $class $this]
  26.     # Start constructor user section
  27.     $this classList [List new]
  28.     # End constructor user section
  29.     return $this
  30. }
  31.  
  32. method CBClassStack::destructor {this} {
  33.     # Start destructor user section
  34.     # End destructor user section
  35. }
  36.  
  37. method CBClassStack::push {this newClass} {
  38.     [$this classList] insert $newClass
  39. }
  40.  
  41. method CBClassStack::pop {this} {
  42.     if {[$this size] == 0} {
  43.         return ""
  44.     }
  45.     set elem [[$this classList] index]
  46.     [$this classList] remove 0
  47.     return $elem
  48. }
  49.  
  50. method CBClassStack::size {this} {
  51.     return [llength [[$this classList] contents]]
  52. }
  53.  
  54. # Do not delete this line -- regeneration end marker
  55.  
  56.