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.
36 @SuppressWarnings("unused")
38 // for serialisation purposes
42 * Create a new {@link Paragraph} with the given image.
47 public Paragraph(URL imageUrl
) {
48 this(ParagraphType
.IMAGE
, imageUrl
.toString(), 1);
52 * Create a new {@link Paragraph} with the given values.
55 * the {@link ParagraphType}
57 * the content of this paragraph
59 * the number of words (or images)
61 public Paragraph(ParagraphType type
, String content
, long words
) {
63 this.content
= content
;
68 * The {@link ParagraphType}.
72 public ParagraphType
getType() {
77 * The {@link ParagraphType}.
82 public void setType(ParagraphType type
) {
87 * The content of this {@link Paragraph}.
91 public String
getContent() {
96 * The content of this {@link Paragraph}.
101 public void setContent(String content
) {
102 this.content
= content
;
106 * The number of words (or images) in this {@link Paragraph}.
108 * @return the number of words
110 public long getWords() {
115 * The number of words (or images) in this {@link Paragraph}.
118 * the number of words to set
120 public void setWords(long words
) {
125 * Display a DEBUG {@link String} representation of this object.
128 public String
toString() {
129 return String
.format("%s: [%s]", "" + type
, "" + content
);