1 package be
.nikiroo
.fanfix
.data
;
6 * A paragraph in a chapter of the story.
10 public class Paragraph
{
12 * A paragraph type, that will dictate how the paragraph will be handled.
16 public enum ParagraphType
{
17 /** Normal paragraph (text) */
21 /** A Break paragraph, i.e.: HR (Horizontal Line) or '* * *' or whatever */
23 /** Quotation (dialogue) */
25 /** An image (no text) */
29 private ParagraphType type
;
30 private String content
;
34 * Create a new {@link Paragraph} with the given image.
39 public Paragraph(URL imageUrl
) {
40 this(ParagraphType
.IMAGE
, imageUrl
.toString(), 0);
44 * Create a new {@link Paragraph} with the given values.
47 * the {@link ParagraphType}
49 * the content of this paragraph
53 public Paragraph(ParagraphType type
, String content
, long words
) {
55 this.content
= content
;
60 * The {@link ParagraphType}.
64 public ParagraphType
getType() {
69 * The {@link ParagraphType}.
74 public void setType(ParagraphType type
) {
79 * The content of this {@link Paragraph}.
83 public String
getContent() {
88 * The content of this {@link Paragraph}.
93 public void setContent(String content
) {
94 this.content
= content
;
98 * The number of words in this {@link Paragraph}.
100 * @return the number of words
102 public long getWords() {
107 * The number of words in this {@link Paragraph}.
110 * the number of words to set
112 public void setWords(long words
) {
117 * Display a DEBUG {@link String} representation of this object.
120 public String
toString() {
121 return String
.format("%s: [%s]", "" + type
, "" + content
);