summaryrefslogtreecommitdiff
path: root/sem_5/HLIN505_Java/HLIN505/src/TP4/Song.java
blob: d82c94f2193d4f71e99b67a5251cff049ae89446 (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
39
40
41
package TP4;

public class Song extends AbstractAudioElement {
	private String artiste;
	private int length;
	private int size;

	public Song (int l, String t,String p, String a) throws IncorrectFileNameException{
		super(p);
		setLength(l);
		setArtiste(a);
		setName(t);
		setSize();
		if (!getFichier().exists()) {
			throw new IncorrectFileNameException(p);
		}
	}
	
	public String getArtiste() {
		return artiste;
	}
	public void setArtiste(String artiste) {
		this.artiste = artiste;
	}
	public int getLength() {
		return length;
	}

	public void setLength(int length)  {
		this.length=length;
	}

	public int getSize() {
		return size;
	}

	public void setSize() throws SecurityException {
		this.size=(int)getFichier().length();
	}

}