1 /***
2 * Paragraph.java
3 *
4 * $Author: mballesteros $
5 * $Date: 2003/11/28 19:18:03 $
6 * $Revision: 1.1 $
7 */
8 package net.sf.jec;
9
10 import java.util.*;
11
12 /***
13 *
14 * @author mballesteros
15 */
16 public class Paragraph {
17
18 /*** Holds value of property text. */
19 private String text;
20
21 /*** Holds value of property wordCount. */
22 private int wordCount;
23
24 /*** Holds value of property page. */
25 private Page page;
26
27 public String toString() {
28 return text;
29 }
30
31 /*** Creates a new instance of Page */
32 public Paragraph(Page page, String text) {
33 this.page = page;
34 setText( text );
35 }
36
37 /*** Getter for property text.
38 * @return Value of property text.
39 */
40 public String getText() {
41 return this.text;
42 }
43
44 /*** Setter for property text.
45 * @param text New value of property text.
46 */
47 public void setText(String text) {
48 this.text = text;
49 if (text != null) {
50 this.wordCount = new StringTokenizer(text).countTokens();
51 } else {
52 this.wordCount = 0;
53 }
54 }
55
56 /*** Getter for property wordCount.
57 * @return Value of property wordCount.
58 */
59 public int getWordCount() {
60 return this.wordCount;
61 }
62
63 /*** Getter for property page.
64 * @return Value of property page.
65 */
66 public Page getPage() {
67 return this.page;
68 }
69 }
This page was automatically generated by Maven