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