Add more warnings source to 1.6) and fix warnings
[nikiroo-utils.git] / src / be / nikiroo / fanfix / data / Paragraph.java
index feb949caf91c87d79e2471f6eed2dc6aceef8fa3..1a7429a403a8a6f0bc0742fb29f14ad2d7811da5 100644 (file)
@@ -28,6 +28,25 @@ public class Paragraph {
 
        private ParagraphType type;
        private String content;
+       private long words;
+
+       /**
+        * Empty constructor, not to use.
+        */
+       @SuppressWarnings("unused")
+       private Paragraph() {
+               // for serialisation purposes
+       }
+
+       /**
+        * Create a new {@link Paragraph} with the given image.
+        * 
+        * @param imageUrl
+        *            the image as an URL
+        */
+       public Paragraph(URL imageUrl) {
+               this(ParagraphType.IMAGE, imageUrl.toString(), 0);
+       }
 
        /**
         * Create a new {@link Paragraph} with the given values.
@@ -36,24 +55,13 @@ public class Paragraph {
         *            the {@link ParagraphType}
         * @param content
         *            the content of this paragraph
+        * @param words
+        *            the number of words
         */
-       public Paragraph(ParagraphType type, String content) {
+       public Paragraph(ParagraphType type, String content, long words) {
                this.type = type;
                this.content = content;
-       }
-
-       /**
-        * Create a new {@link Paragraph} with the given image.
-        * 
-        * @param support
-        *            the support that will be used to fetch the image via
-        *            {@link Paragraph#getContentImage()}.
-        * @param content
-        *            the content image of this paragraph
-        */
-       public Paragraph(URL imageUrl) {
-               this.type = ParagraphType.IMAGE;
-               this.content = imageUrl.toString();
+               this.words = words;
        }
 
        /**
@@ -94,6 +102,25 @@ public class Paragraph {
                this.content = content;
        }
 
+       /**
+        * The number of words in this {@link Paragraph}.
+        * 
+        * @return the number of words
+        */
+       public long getWords() {
+               return words;
+       }
+
+       /**
+        * The number of words in this {@link Paragraph}.
+        * 
+        * @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.
         */