X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fdata%2FParagraph.java;fp=src%2Fbe%2Fnikiroo%2Ffanfix%2Fdata%2FParagraph.java;h=e409c286ae2949be6242c772b6fb7a1783e6a51f;hp=feb949caf91c87d79e2471f6eed2dc6aceef8fa3;hb=793f1071fae48daed3b545a03a286c85e527d244;hpb=b2612f9dcd0a37f4ec22fcabe55390280e06daf2 diff --git a/src/be/nikiroo/fanfix/data/Paragraph.java b/src/be/nikiroo/fanfix/data/Paragraph.java index feb949c..e409c28 100644 --- a/src/be/nikiroo/fanfix/data/Paragraph.java +++ b/src/be/nikiroo/fanfix/data/Paragraph.java @@ -28,19 +28,7 @@ public class Paragraph { private ParagraphType type; private String content; - - /** - * Create a new {@link Paragraph} with the given values. - * - * @param type - * the {@link ParagraphType} - * @param content - * the content of this paragraph - */ - public Paragraph(ParagraphType type, String content) { - this.type = type; - this.content = content; - } + private long words; /** * Create a new {@link Paragraph} with the given image. @@ -52,8 +40,23 @@ public class Paragraph { * the content image of this paragraph */ public Paragraph(URL imageUrl) { - this.type = ParagraphType.IMAGE; - this.content = imageUrl.toString(); + this(ParagraphType.IMAGE, imageUrl.toString(), 0); + } + + /** + * Create a new {@link Paragraph} with the given values. + * + * @param type + * the {@link ParagraphType} + * @param content + * the content of this paragraph + * @param words + * the number of words + */ + public Paragraph(ParagraphType type, String content, long words) { + this.type = type; + this.content = content; + this.words = words; } /** @@ -94,6 +97,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. */