jlint debugging...
[mir.git] / source / mircoders / entity / EntityComment.java
1 package mircoders.entity;
2
3 import java.lang.*;
4 import java.io.*;
5 import java.util.*;
6 import java.sql.*;
7
8 import mir.entity.*;
9 import mir.misc.*;
10 import mir.storage.*;
11
12 import mir.storage.*;
13
14 /**
15  * This class maps one line of the comment-table to a java-object.
16  *
17  * @author RK
18  * @version 1.0
19  */
20
21
22 public class EntityComment extends Entity
23 {
24
25   public EntityComment()
26   {
27     super();
28   }
29
30   public EntityComment(StorageObject theStorage) {
31     this();
32     setStorage(theStorage);
33   }
34
35
36   /**
37    * overridden method setValues to patch creator_main_url
38    */
39   public void setValues(HashMap theStringValues)
40   {
41     if (theStringValues != null) {
42       if (!theStringValues.containsKey("is_published")) {
43        theStringValues.put("is_published","0");
44                         }
45
46                         if (theStringValues.containsKey("main_url")){
47                                 if (((String)theStringValues.get("main_url")).equalsIgnoreCase("http://")) {
48                                         theStringValues.remove("main_url");
49                                 } else if ((!((String)theStringValues.get("main_url")).startsWith("http://"))
50                                                                         && ((String)theStringValues.get("main_url")).length()>0){
51                                         theStringValues.put("main_url","http://"+((String)theStringValues.get("main_url")));
52                                 }
53                         }
54
55     }
56     super.setValues(theStringValues);
57   }
58
59
60 }