1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.ninjasoft.igallery.data;
18
19 import java.util.*;
20
21 /***
22 * Simple bean to wrap album information
23 * @author enigma
24 */
25 public class GalleryAlbum {
26 private int refNumber = 0;
27 private String name = "";
28 private String title = "";
29 private String summary = "";
30 private String parent = "";
31 private GalleryAlbum parentAlbum = null;
32 private Vector images = null;
33
34 public String toString() {
35 StringBuffer result = new StringBuffer();
36 if (parentAlbum != null) {
37 result.append(parentAlbum.toString());
38 result.append(" / ");
39 }
40 result.append(Integer.toString(refNumber));
41 result.append(":");
42 result.append(name);
43 return result.toString();
44 }
45
46 /***
47 * @return Returns the name.
48 */
49 public String getName() {
50 return name;
51 }
52 /***
53 * @param name The name to set.
54 */
55 public void setName(String name) {
56 this.name = name;
57 }
58 /***
59 * @return Returns the parent.
60 */
61 public String getParent() {
62 return parent;
63 }
64 /***
65 * @param parent The parent to set.
66 */
67 public void setParent(String parent) {
68 this.parent = parent;
69 }
70 /***
71 * @return Returns the refNumber.
72 */
73 public int getRefNumber() {
74 return refNumber;
75 }
76 /***
77 * @param refNumber The refNumber to set.
78 */
79 public void setRefNumber(int refNumber) {
80 this.refNumber = refNumber;
81 }
82 /***
83 * @return Returns the summary.
84 */
85 public String getSummary() {
86 return summary;
87 }
88 /***
89 * @param summary The summary to set.
90 */
91 public void setSummary(String summary) {
92 this.summary = summary;
93 }
94 /***
95 * @return Returns the title.
96 */
97 public String getTitle() {
98 return title;
99 }
100 /***
101 * @param title The title to set.
102 */
103 public void setTitle(String title) {
104 this.title = title;
105 }
106 /***
107 * @return Returns the parentAlbum.
108 */
109 public GalleryAlbum getParentAlbum() {
110 return parentAlbum;
111 }
112 /***
113 * @param parentAlbum The parentAlbum to set.
114 */
115 public void setParentAlbum(GalleryAlbum parentAlbum) {
116 this.parentAlbum = parentAlbum;
117 }
118
119 public void addPicture(GalleryPicture i) {
120 if (images == null)
121 images = new Vector();
122 this.images.add(i);
123 }
124 public void addPictures(Collection c) {
125 if (images == null)
126 images = new Vector();
127 this.images.addAll(c);
128 }
129 public Vector getPictures() {
130 if (images == null)
131 images = new Vector();
132 return this.images;
133 }
134 public int getPictureCount() {
135 if (images != null)
136 return this.images.size();
137 return -1;
138 }
139 public void resetPictures() {
140 this.images = null;
141 }
142 }