X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fdata%2FStory.java;h=fc3f909880031910c5b1ff698b247c949d6ffe38;hb=36c35b92f704ed40f3ce80501dc96cce73d39ceb;hp=0e0279f096adad91003c62e290fdefb60f1cfec6;hpb=b5e9855b962842b306c17688c1c793dc1378ea62;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/data/Story.java b/src/be/nikiroo/fanfix/data/Story.java deleted file mode 100644 index 0e0279f..0000000 --- a/src/be/nikiroo/fanfix/data/Story.java +++ /dev/null @@ -1,98 +0,0 @@ -package be.nikiroo.fanfix.data; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -/** - * The main data class, where the whole story resides. - * - * @author niki - */ -public class Story implements Iterable, Cloneable { - private MetaData meta; - private List chapters = new ArrayList(); - private List empty = new ArrayList(); - - /** - * The metadata about this {@link Story}. - * - * @return the meta - */ - public MetaData getMeta() { - return meta; - } - - /** - * The metadata about this {@link Story}. - * - * @param meta - * the meta to set - */ - public void setMeta(MetaData meta) { - this.meta = meta; - } - - /** - * The chapters of the story. - * - * @return the chapters - */ - public List getChapters() { - return chapters; - } - - /** - * The chapters of the story. - * - * @param chapters - * the chapters to set - */ - public void setChapters(List chapters) { - this.chapters = chapters; - } - - /** - * Get an iterator on the {@link Chapter}s. - */ - @Override - public Iterator iterator() { - return chapters == null ? empty.iterator() : chapters.iterator(); - } - - /** - * Display a DEBUG {@link String} representation of this object. - *

- * This is not efficient, nor intended to be. - */ - @Override - public String toString() { - if (getMeta() != null) - return "Story: [\n" + getMeta().toString() + "\n]"; - return "Story: [ no metadata found ]"; - } - - @Override - public Story clone() { - Story story = null; - try { - story = (Story) super.clone(); - } catch (CloneNotSupportedException e) { - // Did the clones rebel? - System.err.println(e); - } - - if (meta != null) { - story.meta = meta.clone(); - } - - if (chapters != null) { - story.chapters = new ArrayList(); - for (Chapter chap : chapters) { - story.chapters.add(chap.clone()); - } - } - - return story; - } -}