Universität Ulm,
Fakultät für Mathematik und Wirtschaftswissenschaften,
SAI
WS 97/98 || Entwicklung objekt-orientierter Bibliotheken || Beispiele || Collections-15
DEFINITION PrintableObjects
DEFINITION PrintableObjects;
IMPORT Services, Streams;
(* secondary abstraction for printable objects
which is usually to be supported by type-dependent modules
*)
TYPE
PrintProc = PROCEDURE (s: Streams.Stream; object: Services.Object);
PROCEDURE Support(for: Services.Type; print: PrintProc);
(* supply print method for all instances of `for' and its extensions *)
PROCEDURE SetDefault(s: Streams.Stream; default: ARRAY OF CHAR);
(* sets the per-stream default output text for objects
which do not have an associated print method
*)
PROCEDURE Print(s: Streams.Stream; object: Services.Object);
(* call the print method of `object', or, if not present,
the per-stream default text, or, if not present, a question mark
*)
END PrintableObjects.
WS 97/98 || Entwicklung objekt-orientierter Bibliotheken || Beispiele || Collections-15
Andreas Borchert, 15. Januar 1998