aboutsummaryrefslogtreecommitdiff
path: root/MusicalElement.java
blob: 9dbb0446006b52b734c3ccabd64a992293fb3e8f (plain)
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
import java.io.Serializable;

/** The MusicalElement contains the base of songs and audibooks.
 * It is the abstract class they will take.
 * We use the classical get and set here.
 * Get is used to return the said value.
 * Set is used to modify the later.*/

public abstract class MusicalElement implements Serializable {

//Our vars
	private int id, duration;
	private String title, content;
	private static int idCount=0;


	public MusicalElement(String title, int duration, String content) {
		this.setId(idCount++);
		this.title=title;
		this.duration=duration;
		this.content=content;
	}

//the gets
	public int getId(){return id;}
	public String getTitle(){return title;}
	public int getDuration(){return duration;}
	public String getContent(){return content;}

//the sets
	public void setId(int id){this.id=id;}
	public void setTitle(String title){this.title=title;}
	public void setDuration(int duration){this.duration=duration;}
	public void setContent(String content){this.content=content;}



}