-
Notifications
You must be signed in to change notification settings - Fork 0
/
AudioTrack.java
103 lines (91 loc) · 1.92 KB
/
AudioTrack.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
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
/* @st20102906 1.0 06/12/2016
*
* Matthew Aaron Roberts, 2016
* Student number: st20102906
*/
package st20102906;
/**
* AudioTrack.java - a class to represent playable Audio Tracks.
*
* @author Matthew Roberts
* @version 1.0
* @see Media
*/
public class AudioTrack extends Media{
// declared private - encapsulation
private String creator;
private double duration;
private String recordLabel;
/**
* Class constructor specifying Audio Track attributes.
*
* @param title
* @param creator
* @param yearOfRelease
* @param duration
* @param recordLabel
* @param rating
*/
public AudioTrack(String title, String creator, int yearOfRelease, double duration, String recordLabel, int rating)
{
// invoke superclass constructor
super(title, yearOfRelease, rating);
this.creator = creator;
this.duration = duration;
this.recordLabel = recordLabel;
}
/**
* Sets a value for creator.
*
* @param creator
*/
public void setCreator(String creator)
{
this.creator = creator;
}
/**
* Sets a total duration value.
*
* @param duration
*/
public void setDuration(double duration)
{
this.duration = duration;
}
/**
* Sets a value for record label.
*
* @param recordLabel
*/
public void setRecordLabel(String recordLabel)
{
this.recordLabel = recordLabel;
}
/**
* Returns the creator as a String.
*
* @return a String data type.
*/
public String getCreator()
{
return this.creator;
}
/**
* 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 record label as a String.
*
* @return a String value for record label.
*/
public String getRecordLabel()
{
return this.recordLabel;
}
}