home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / SOFTWARE / SOURCES / ADACRAFT.ZIP / ch10 / jediarie.ads (.txt) < prev   
Text File  |  1996-11-29  |  2KB  |  43 lines

  1. ----------------------------------------------------------------------------
  2. --
  3. --   File:    je-diaries.ads
  4. --   Purpose: Diary ADT (specification)
  5. --   Author:  John English (je@brighton.ac.uk)
  6. --
  7. --   This code is from "Ada 95: The Craft of Object-Oriented Programming"
  8. --   by John English (Prentice Hall 1997). Copyright (c) John English.
  9. --   Permission is granted to copy and distribute this file for
  10. --   non-commercial use only.
  11. --
  12. ----------------------------------------------------------------------------
  13.  
  14. with JE.Appointments;
  15. use  JE.Appointments;
  16. package JE.Diaries is
  17.     type Diary_Type is limited private;
  18.  
  19.     procedure Load   (Diary : in out Diary_Type;
  20.                       From  : in String);
  21.     procedure Save   (Diary : in Diary_Type;
  22.                       To    : in String);
  23.  
  24.     procedure Add    (Diary : in out Diary_Type;
  25.                       Appt  : in Appointment_Type);
  26.     procedure Delete (Diary : in out Diary_Type;
  27.                       Appt  : in Positive);
  28.     function  Choose (Diary : Diary_Type;
  29.                       Appt  : Positive)   return Appointment_Type;
  30.     function  Size   (Diary : Diary_Type) return Natural;
  31.  
  32.     Diary_Error : exception;
  33.  
  34. private
  35.     type Appointment_Array is
  36.         array (Positive range <>) of Appointment_Type;
  37.     type Diary_Type is
  38.         record
  39.             Appts : Appointment_Array (1..10);      -- an arbitrary size
  40.             Count : Natural := 0;
  41.         end record;
  42. end JE.Diaries;
  43.