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.
37 * the support that will be used to fetch the image via
38 * {@link Paragraph#getContentImage()}.
40 * the content image of this paragraph
42 public Paragraph(URL imageUrl
) {
43 this(ParagraphType
.IMAGE
, imageUrl
.toString(), 0);
47 * Create a new {@link Paragraph} with the given values.
50 * the {@link ParagraphType}
52 * the content of this paragraph
56 public Paragraph(ParagraphType type
, String content
, long words
) {
58 this.content
= content
;
63 * The {@link ParagraphType}.
67 public ParagraphType
getType() {
72 * The {@link ParagraphType}.
77 public void setType(ParagraphType type
) {
82 * The content of this {@link Paragraph}.
86 public String
getContent() {
91 * The content of this {@link Paragraph}.
96 public void setContent(String content
) {
97 this.content
= content
;
101 * The number of words in this {@link Paragraph}.
103 * @return the number of words
105 public long getWords() {
110 * The number of words in this {@link Paragraph}.
113 * the number of words to set
115 public void setWords(long words
) {
120 * Display a DEBUG {@link String} representation of this object.
123 public String
toString() {
124 return String
.format("%s: [%s]", "" + type
, "" + content
);