(no commit message)
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 25 Mar 2006 18:02:05 +0000 (18:02 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 25 Mar 2006 18:02:05 +0000 (18:02 +0000)
crawler/kiss/src/org/wamblee/crawler/kiss/guide/Program.java

index 28cbec5b406f22b6fee880bfba685047e4557f27..241089b1e7de507d8189a1f1081f386d6ad2eb04 100644 (file)
@@ -32,6 +32,22 @@ import org.wamblee.crawler.kiss.main.SystemProperties;
  */
 public class Program {
 
+    private static final String ELEM_PROGRAM = "program";
+
+    private static final String ELEM_NAME = "name";
+
+    private static final String ELEM_KEYWORDS = "keywords";
+
+    private static final String ELEM_DESCRIPTION = "description";
+
+    private static final String ELEM_CHANNEL = "channel";
+
+    private static final String ELEM_INTERVAL = "interval";
+
+    private static final String ELEM_END_TIME = "end";
+
+    private static final String ELEM_BEGIN_TIME = "begin";
+
     /**
      * Lexicographical comparison of programs based on (time, title, channel).
      * 
@@ -106,8 +122,9 @@ public class Program {
         }
 
         /**
-         * Gets the description. 
-         * @return Description. 
+         * Gets the description.
+         * 
+         * @return Description.
          */
         public String getDescription() {
             return _description;
@@ -321,15 +338,16 @@ public class Program {
      */
     public Element asXml() {
         DocumentFactory factory = DocumentFactory.getInstance();
-        Element program = factory.createElement("program");
-        program.addElement("name").setText(getName());
-        program.addElement("description").setText(getDescription());
-        program.addElement("keywords").setText(getKeywords());
-        program.addElement("channel").setText(getChannel());
-        Element interval = program.addElement("interval");
-        interval.addElement("begin").setText(
+        Element program = factory.createElement(ELEM_PROGRAM);
+        program.addElement(ELEM_NAME).setText(getName());
+        program.addElement(ELEM_DESCRIPTION).setText(getDescription());
+        program.addElement(ELEM_KEYWORDS).setText(getKeywords());
+        program.addElement(ELEM_CHANNEL).setText(getChannel());
+        Element interval = program.addElement(ELEM_INTERVAL);
+        interval.addElement(ELEM_BEGIN_TIME).setText(
                 getInterval().getBegin().toString());
-        interval.addElement("end").setText(getInterval().getEnd().toString());
+        interval.addElement(ELEM_END_TIME).setText(
+                getInterval().getEnd().toString());
         return program;
     }
 }