-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlbum.java
41 lines (31 loc) · 933 Bytes
/
Album.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
package gallery;
import java.util.ArrayList;
public class Album {
//unique
private String title;
ArrayList<Photo> photoalbum = new ArrayList<Photo>();
//Setter and Getter for the private attributes
public String getTitle() {
return title;
}
public ArrayList<Photo> getPhotoalbum() {
return photoalbum;
}
public void setTitle(String title) {
this.title = title;
}
public void setList(ArrayList<Photo> list) {
this.photoalbum = list;
}
public String print(){
String rr = "";
for(Photo r : photoalbum)
rr += r.getFileName() + " " + r.getYear() + " " + r.getTagged()+ "\n";
return rr;
}
// toString method used to print invormation of the class .
@Override
public String toString() {
return " Album " + title + "\n" + print() ;
}
}