This repository was archived by the owner on May 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDVD.java
More file actions
130 lines (115 loc) · 3.46 KB
/
DVD.java
File metadata and controls
130 lines (115 loc) · 3.46 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import java.util.ArrayList;
import java.util.List;
import javafx.scene.image.Image;
public class DVD extends Resource {
/**
* The attributes/variables/fields of a DVD which is inherited from resource
*/
public static int uniqueCopyID = 0;
public List<Copy> copies = new ArrayList<Copy>();
protected int resourceID;
protected String title;
protected int year;
protected Image image;
//protected boolean checkCopies;
//protected int numOfCopies;
/**
* The attributes/variables/fields of a DVD
*/
private String director;
private int runTime;
private String subtitles;
private String language;
/**
* Constructor of a DVD
* @param resourceID resourceID of a DVD
* @param title title of a DVD
* @param year year of a DVD
* @param image thumbnail image of a DVD
* @param director director of a DVD
* @param runTime run time of a DVD
* @param genre genre of a DVD
* @param isbn isbn of a DVD
* @param language language of a DVD
*/
public DVD(int resourceID, int numberOfCopies, String title, int year, String image, String director, int runTime, String language, String subtitles) {
super(resourceID, numberOfCopies, title, year, image);
super.setResourceID(resourceID);
super.setNumCopies(numberOfCopies);
super.setTitle(title);
super.setYear(year);
super.setImage(image);
setDirector(director);
setRunTime(runTime);
setSubtitles(subtitles);
setLanguage(language);
}
/**
* Getting the director of a DVD
* @return director the director of a DVD
*/
public String getDirector() {
return director;
}
/**
* Getting the run time of a DVD
* @return runTime the run time of a DVD
*/
public int getRunTime() {
return runTime;
}
/**
* Getting the ISBN of a DVD
* @return isbn the ISBN of a DVD
*/
public String getSubtitles() {
return subtitles;
}
/**
* Getting the language of a DVD
* @return language the language of a DVD
*/
public String getLanguage() {
return language;
}
/**
* Setting the director of a DVD
* @param director the director of a DVD
*/
public void setDirector(String director) {
this.director = director;
}
/**
* Setting the run time of a DVD
* @param runTime the run time of a DVD
*/
public void setRunTime(int runTime) {
this.runTime = runTime;
}
/**
* Setting the subtitles of a DVD
* @param isbn the subtitles of a DVD
*/
public void setSubtitles(String isbn) {
this.subtitles = isbn;
}
/**
* Setting the language of a DVD
* @param language the language of a DVD
*/
public void setLanguage(String language) {
this.language = language;
}
// we override because it passes this object, rather than going through a mess
// of finding what object this is
@Override
public DVD getObject() {
return this;
}
@Override
public String translateToText() {
return "DVD, " + this.getNumCopies() + ", " + this.getResourceID() + ", " + this.getTitle() + ", " +
this.getYear() + ", " + this.getImage() + ", " + this.getDirector() + ", " + this.getRunTime() + ", " +
this.getLanguage() + ", " + this.getSubtitles();
}
}