X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fdata%2FParagraph.java;h=e4c94d45710bdb2f8b1cd9cd7f655f8ef490f861;hb=0d781e306746cf460f1f41338eb437f32cf9db33;hp=feb949caf91c87d79e2471f6eed2dc6aceef8fa3;hpb=08fe2e33007063e30fe22dc1d290f8afaa18eb1d;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/data/Paragraph.java b/src/be/nikiroo/fanfix/data/Paragraph.java index feb949c..e4c94d4 100644 --- a/src/be/nikiroo/fanfix/data/Paragraph.java +++ b/src/be/nikiroo/fanfix/data/Paragraph.java @@ -28,6 +28,17 @@ public class Paragraph { private ParagraphType type; private String content; + private long words; + + /** + * 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 +47,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 +94,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. */