-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDocument.java
executable file
·49 lines (38 loc) · 1.13 KB
/
Document.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* ********************************************************************
* File: Document.java (Class)
* Author: P. Howells
* Contents: 6SENG002W CWK
* This provides an "abstract" document object.
* It includes the user id, the document's name & its length
* in pages.
* Date: 26/10/18
* Version: 1.0
* ***********************************************************************
*/
class Document {
private final String userID;
private final String documentName;
private final int numberOfPages;
public Document(String UID, String name, int length) {
this.userID = UID;
this.documentName = name;
this.numberOfPages = length;
}
public String getUserID() {
return userID;
}
public String getDocumentName() {
return documentName;
}
public int getNumberOfPages() {
return numberOfPages;
}
public String toString() {
return new String("Document[ " +
"UserID: " + userID + ", " +
"Name: " + documentName + ", " +
"Pages: " + numberOfPages +
"]");
}
} // Document