home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / os2tk21j / c / samples / tp / textline.cs_ / textline.csc
Encoding:
Text File  |  1993-03-12  |  1.8 KB  |  74 lines

  1. #   @(#)textline.csc 1.3 1/22/92 16:11:18 [1/26/92] (c)IBM Corp. 1992
  2.  
  3. -- This class is adapted from the book
  4. --   Class Construction in C and C++, Object Oriented Fundamentals
  5. --   by Roger Sessions, Copyright (c) 1992 Prentice Hall.
  6. -- Reprinted with permission.
  7.  
  8. include "ll.sc"
  9.  
  10. class: textLine,
  11.   local;
  12.  
  13. parent: linkedList;
  14.  
  15. /*
  16. ----------------------------------------------------
  17.   Class: textLine
  18.  
  19. Purpose: This is a low-level storage class.  It
  20.      represents a specialized version of a linkedList.
  21.      A textLine is a linkedList which is only used for
  22.      storing TPWords.  It has additional methods (over
  23.      and above the linkedList methods) which deal with
  24.      the number of characters in a line.  The linkedList
  25.      method llAddTail is overridden to allow character
  26.      counts to be updated as TPWords are inserted in
  27.      the list.  The linkedList method llReplace is
  28.      not supported in this derived class.
  29. ---------------------------------------------------- */
  30.  
  31.  
  32. data:
  33.  
  34.   int maxSize;
  35.   int totalChars;
  36.  
  37. methods:
  38.  
  39. group: Group1;
  40.  
  41. group: newMethods;
  42.  
  43.    void tlInit(int newSize);
  44.    -- Initialize a new text line with the number of characters
  45.    -- it can contain.
  46.  
  47.    int tlCharsInLine();
  48.    -- Returns the number of characters in a textLine.
  49.  
  50.    int tlCharsLeft();
  51.    -- Returns the number of characters that can still be placed
  52.    -- in the textLine.
  53.  
  54. group: OverriddenLinkedListMethods;
  55.  
  56.    override llAddTail;
  57.    -- See the linkedList definition for more information.
  58.  
  59.    override llAddHead;
  60.    -- See the linkedList definition for more information.
  61.  
  62. group: UnsupportedLinkedListMethods;
  63.  
  64.    override llReplace;
  65.    -- Cannot be called for textLines.
  66.  
  67. group: SystemMethodOverrides;
  68.  
  69.    override somInit;
  70.  
  71.    override somUninit;
  72.  
  73.    override somDumpSelfInt;
  74.