Network server and Library + nikiroo-utils update
[nikiroo-utils.git] / src / be / nikiroo / fanfix / data / Chapter.java
index 551606348843446c00ddc59fc53827e7a3e35aa9..d9f285f96762ce135b8046578f0df9d75d31b819 100644 (file)
@@ -14,6 +14,14 @@ public class Chapter implements Iterable<Paragraph> {
        private int number;
        private List<Paragraph> paragraphs = new ArrayList<Paragraph>();
        private List<Paragraph> empty = new ArrayList<Paragraph>();
+       private long words;
+
+       /**
+        * Empty constructor, not to use.
+        */
+       private Chapter() {
+               // for serialisation purposes
+       }
 
        /**
         * Create a new {@link Chapter} with the given information.
@@ -78,7 +86,7 @@ public class Chapter implements Iterable<Paragraph> {
        /**
         * The included paragraphs.
         * 
-        * @param paragraphes
+        * @param paragraphs
         *            the paragraphs to set
         */
        public void setParagraphs(List<Paragraph> paragraphs) {
@@ -92,6 +100,25 @@ public class Chapter implements Iterable<Paragraph> {
                return paragraphs == null ? empty.iterator() : paragraphs.iterator();
        }
 
+       /**
+        * The number of words in this {@link Chapter}.
+        * 
+        * @return the number of words
+        */
+       public long getWords() {
+               return words;
+       }
+
+       /**
+        * The number of words in this {@link Chapter}.
+        * 
+        * @param words
+        *            the number of words to set
+        */
+       public void setWords(long words) {
+               this.words = words;
+       }
+
        /**
         * Display a DEBUG {@link String} representation of this object.
         */