1 package net.sourceforge.phpeclipse.wiki.xml;
3 import java.util.ArrayList;
9 * <page> XML data from Wikipedia Special:Export pages may be <code>null</code>
13 /* package private */String title = null;
15 /* package private */ArrayList listOfRevisions = null;
17 // Revision revision = null;
19 /* package private */Page() {
22 public Page(String timeStamp, String title, String body) {
23 listOfRevisions = new ArrayList();
24 Revision revision = new Revision(timeStamp, body);
25 listOfRevisions.add(revision);
29 public void add(Revision revision) {
30 listOfRevisions.add(revision);
36 * @see java.lang.Object#toString()
38 public String toString() {
39 StringBuffer buffer = new StringBuffer();
42 buffer.append("==>Title: ");
47 // if (revision != null) {
48 // buffer.append("==>Revision:\n");
49 // buffer.append(revision);
50 // buffer.append("\n");
52 for (int i = 0; i < listOfRevisions.size(); i++) {
53 Revision revision = (Revision) listOfRevisions.get(i);
54 if (revision != null) {
55 buffer.append("==>Revision:\n");
56 buffer.append(revision);
60 return buffer.toString();
64 * @return Returns the title.
66 public String getTitle() {
70 public String getURLTitle() {
71 return title.replaceAll(" ", "_");
77 public boolean isEmpty() {
78 return listOfRevisions.isEmpty();
85 return listOfRevisions.size();
92 public Revision get(int index) {
93 return (Revision) listOfRevisions.get(index);