-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilm.java
More file actions
105 lines (93 loc) · 1.93 KB
/
Film.java
File metadata and controls
105 lines (93 loc) · 1.93 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
/* @st20102906 1.0 06/12/2016
*
* Matthew Aaron Roberts, 2016
* Student number: st20102906
*/
package st20102906;
/**
* Film.java - a class to represent playable Films.
*
* @author Matthew Roberts
* @version 1.0
* @see Media
*/
public class Film extends Media
{
// declared private - encapsulation
private double duration;
private String studio;
private String director;
/**
* Class constructor specifying Film attributes. Superclass is invoked
* to specify title, yearOfRelease and rating.
*
* @param title
* @param yearOfRelease
* @param duration
* @param studio
* @param director
* @param rating
*/
public Film(String title, int yearOfRelease, double duration, String studio, String director, int rating)
{
// invoke superclass constructor
super(title, yearOfRelease, rating);
this.duration = duration;
this.studio = studio;
this.director = director;
}
/**
* Sets a total duration value.
*
* @param duration
*/
public void setDuration(double duration)
{
this.duration = duration;
}
/**
* Sets a value for the studio.
*
* @param studio
*/
public void setStudio(String studio)
{
this.studio = studio;
}
/**
* Sets a value for the director.
*
* @param director
*/
public void setDirector(String director)
{
this.director = director;
}
/**
* Returns the total duration value in minutes, as a double.
*
* @return a double value for duration in minutes.
*/
public double getDuration()
{
return this.duration;
}
/**
* Returns the name of the studio as a String.
*
* @return a String value for studio.
*/
public String getStudio()
{
return this.studio;
}
/**
* Returns the name of the film director as a String.
*
* @return a String value for director.
*/
public String getDirector()
{
return this.director;
}
}