1 package be
.nikiroo
.fanfix
.data
;
3 import java
.awt
.image
.BufferedImage
;
4 import java
.util
.ArrayList
;
8 * The meta data associated to a {@link Story} object.
12 public class MetaData
implements Cloneable
{
14 private String author
;
16 private Chapter resume
;
17 private List
<String
> tags
;
18 private BufferedImage cover
;
19 private String subject
;
20 private String source
;
25 private String publisher
;
27 private boolean imageDocument
;
30 * The title of the story.
34 public String
getTitle() {
39 * The title of the story.
44 public void setTitle(String title
) {
49 * The author of the story.
53 public String
getAuthor() {
58 * The author of the story.
63 public void setAuthor(String author
) {
68 * The story publication date.
72 public String
getDate() {
77 * The story publication date.
82 public void setDate(String date
) {
87 * The tags associated with this story.
91 public List
<String
> getTags() {
96 * The tags associated with this story.
101 public void setTags(List
<String
> tags
) {
106 * The story resume (a.k.a. description).
110 public Chapter
getResume() {
115 * The story resume (a.k.a. description).
120 public void setResume(Chapter resume
) {
121 this.resume
= resume
;
125 * The cover image of the story if any (can be NULL).
129 public BufferedImage
getCover() {
134 * The cover image of the story if any (can be NULL).
139 public void setCover(BufferedImage cover
) {
144 * The subject of the story (or instance, if it is a fanfiction, what is the
145 * original work; if it is a technical text, what is the technical
148 * @return the subject
150 public String
getSubject() {
155 * The subject of the story (for instance, if it is a fanfiction, what is
156 * the original work; if it is a technical text, what is the technical
162 public void setSubject(String subject
) {
163 this.subject
= subject
;
167 * The source of this story (which online library it was downloaded from).
171 public String
getSource() {
176 * The source of this story (which online library it was downloaded from).
181 public void setSource(String source
) {
182 this.source
= source
;
186 * The original URL from which this {@link Story} was imported.
190 public String
getUrl() {
195 * The original URL from which this {@link Story} was imported.
200 public void setUrl(String url
) {
205 * A unique value representing the story (it is often a URL).
209 public String
getUuid() {
214 * A unique value representing the story (it is often a URL).
219 public void setUuid(String uuid
) {
224 * A unique value representing the story in the local library.
228 public String
getLuid() {
233 * A unique value representing the story in the local library.
238 public void setLuid(String luid
) {
243 * The 2-letter code language of this story.
247 public String
getLang() {
252 * The 2-letter code language of this story.
257 public void setLang(String lang
) {
262 * The story publisher (other the same as the source).
264 * @return the publisher
266 public String
getPublisher() {
271 * The story publisher (other the same as the source).
274 * the publisher to set
276 public void setPublisher(String publisher
) {
277 this.publisher
= publisher
;
281 * The output type this {@link Story} is in.
283 * @return the type the type
285 public String
getType() {
290 * The output type this {@link Story} is in.
293 * the new type to set
295 public void setType(String type
) {
300 * Document catering mostly to image files.
302 * @return the imageDocument state
304 public boolean isImageDocument() {
305 return imageDocument
;
309 * Document catering mostly to image files.
311 * @param imageDocument
312 * the imageDocument state to set
314 public void setImageDocument(boolean imageDocument
) {
315 this.imageDocument
= imageDocument
;
319 public MetaData
clone() {
320 MetaData meta
= null;
322 meta
= (MetaData
) super.clone();
323 } catch (CloneNotSupportedException e
) {
324 // Did the clones rebel?
325 System
.err
.println(e
);
329 meta
.tags
= new ArrayList
<String
>();
330 meta
.tags
.addAll(tags
);
332 if (resume
!= null) {
333 meta
.resume
= new Chapter(resume
.getNumber(), resume
.getName());
334 for (Paragraph para
: resume
) {
335 meta
.resume
.getParagraphs().add(para
);