-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocument.java
More file actions
88 lines (73 loc) · 2.06 KB
/
Copy pathDocument.java
File metadata and controls
88 lines (73 loc) · 2.06 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
*
* @author Zach Sims, Rylan Kettles, Brandon Khoo
*/
public abstract class Document {
protected String title;
protected String authorName;
protected String path;
protected int isbn;
protected int stockCount;
protected double price;
protected PublishStrategy publishStrategy;
public abstract String getType();
public Document(String title, String authorName, double price, int isbn, String path , int stockCount) {
this.title = title;
this.authorName = authorName;
this.isbn = isbn;
this.path = path;
this.stockCount = stockCount;
this.price = price;
}
public void setPublishStrategy(PublishStrategy strategy){
this.publishStrategy = strategy;
}
public void executeStrategy(){
publishStrategy.publish();
}
public String getAuthorName() {
return authorName;
}
public void setAuthorName(String authorName) {
this.authorName = authorName;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public int getIsbn() {
return isbn;
}
public void setIsbn(int isbn) {
this.isbn = isbn;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getStockCount() {
return stockCount;
}
public void setStockCount(int stockCount) {
this.stockCount = stockCount;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public void display(){
System.out.println("Title: " + title);
System.out.println("Name of Author: " + authorName);
System.out.println("Price: " + price);
System.out.println("Path to document: " + path);
System.out.println("ISBN: " + isbn);
System.out.println("Remaining Stock: " + stockCount);
System.out.println();
}
}