7fd59977 |
1 | -- File: CDF_Directory.cdl |
2 | -- Created: Thu Aug 7 16:57:46 1997 |
3 | -- Author: Jean-Louis Frenkel |
4 | -- <rmi@frilox.paris1.matra-dtv.fr> |
5 | ---Copyright: Matra Datavision 1997 |
6 | |
7 | class Directory from CDF inherits Transient from Standard |
8 | |
9 | |
10 | ---Purpose: A directory is a collection of documents. There is only one instance |
11 | -- of a given document in a directory. |
12 | -- put. |
13 | |
14 | uses Document from CDM, ListOfDocument from CDM |
15 | |
16 | raises NoSuchObject |
17 | |
18 | is |
19 | Create |
20 | returns mutable Directory from CDF; |
21 | ---Purpose: Creates an empty directory. |
22 | |
23 | |
24 | Add(me:mutable; aDocument: Document from CDM); |
25 | ---Purpose: adds a document into the directory. |
26 | |
27 | Remove(me: mutable; aDocument: Document from CDM); |
28 | ---Purpose: removes the document. |
29 | |
30 | |
31 | ---Category: Inquire Methods |
32 | -- |
33 | |
34 | Contains(me; aDocument: Document from CDM) |
35 | ---Purpose: Returns true if the document aDocument is in the directory |
36 | returns Boolean from Standard |
37 | is static; |
38 | |
39 | Last(me:mutable) returns Document from CDM |
40 | ---Purpose: returns the last document (if any) which has been added |
41 | -- in the directory. |
42 | raises NoSuchObject from Standard |
43 | ---Warning: if the directory is empty. |
44 | is static; |
45 | |
46 | Length(me) returns Integer from Standard |
47 | ---Purpose: returns the number of documents of the directory. |
48 | is static; |
49 | |
50 | IsEmpty(me) returns Boolean from Standard |
51 | ---Purpose: returns true if the directory is empty. |
52 | is static; |
53 | |
54 | ---Category: Private methods |
55 | |
56 | List(me) returns ListOfDocument from CDM |
57 | is static private; |
58 | ---C++: return const & |
59 | -- |
60 | |
61 | fields |
62 | |
63 | myDocuments: ListOfDocument from CDM; |
64 | |
65 | friends |
66 | class DirectoryIterator from CDF |
67 | |
68 | end Directory from CDF; |