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 * Empty constructor, not to use.
37 // for serialisation purposes
41 * Create a new {@link Paragraph} with the given image.
46 public Paragraph(URL imageUrl
) {
47 this(ParagraphType
.IMAGE
, imageUrl
.toString(), 0);
51 * Create a new {@link Paragraph} with the given values.
54 * the {@link ParagraphType}
56 * the content of this paragraph
60 public Paragraph(ParagraphType type
, String content
, long words
) {
62 this.content
= content
;
67 * The {@link ParagraphType}.
71 public ParagraphType
getType() {
76 * The {@link ParagraphType}.
81 public void setType(ParagraphType type
) {
86 * The content of this {@link Paragraph}.
90 public String
getContent() {
95 * The content of this {@link Paragraph}.
100 public void setContent(String content
) {
101 this.content
= content
;
105 * The number of words in this {@link Paragraph}.
107 * @return the number of words
109 public long getWords() {
114 * The number of words in this {@link Paragraph}.
117 * the number of words to set
119 public void setWords(long words
) {
124 * Display a DEBUG {@link String} representation of this object.
127 public String
toString() {
128 return String
.format("%s: [%s]", "" + type
, "" + content
);