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.
* 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;
}
/**
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.
*/