some corrections and parent-child-relation of topic
[mir.git] / source / mir / core / model / Topic.java
index e6cbf74..3ab8249 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Topic.java
+ * TopicStub.java created on 30.08.2003
  * 
  * Copyright (C) 2001, 2002, 2003 The Mir-coders group
  *
@@ -39,51 +39,68 @@ import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.apache.commons.lang.builder.ToStringBuilder;
 
 /**
- * 
- * Topic
+ * TopicStub
  * @author idefix
- * @version $Id: Topic.java,v 1.3 2003/09/05 20:23:59 idfx Exp $
+ * @version $Id: Topic.java,v 1.4 2003/09/30 19:26:02 idfx Exp $
  */
-public class Topic extends TopicStub implements Serializable {
-    
-    private Set content;
+public class Topic extends TopicCore implements Serializable {
+       
+       private Set childTopics;
+       private Topic parentTopic;
+
+       /**
+        * 
+        */
+       public Topic() {
+               super();
+       }
 
-    /** default constructor */
-    public Topic() {
-                       super();
-    }
-               /**
-                * @return
-                */
-               public Set getContent() {
-                       return content;
-               }
+       /**
+        * @return
+        */
+       public Set getChildTopics() {
+               return childTopics;
+       }
 
-               /**
-                * @param content
-                */
-               public void setContent(Set content) {
-                       this.content = content;
-               }
+       /**
+        * @param set
+        */
+       public void setChildTopics(Set set) {
+               childTopics = set;
+       }
+       
+       /**
+        * @return
+        */
+       public Topic getParentTopic() {
+               return parentTopic;
+       }
 
-    public String toString() {
-        return new ToStringBuilder(this)
-            .append("id", getId())
-            .toString();
-    }
+       /**
+        * @param topic
+        */
+       public void setParentTopic(Topic topic) {
+               parentTopic = topic;
+       }
 
-    public boolean equals(Object other) {
-        if ( !(other instanceof Topic) ) return false;
-        Topic castOther = (Topic) other;
-        return new EqualsBuilder()
-            .append(this.getId(), castOther.getId())
-            .isEquals();
-    }
+       public String toString() {
+                       return new ToStringBuilder(this)
+                                       .append("id", getId())
+                                       .append("title", getTitle())
+                                       .toString();
+       }
 
-    public int hashCode() {
-        return new HashCodeBuilder()
-            .append(getId())
-            .toHashCode();
-    }
+       public boolean equals(Object other) {
+                       if ( !(other instanceof Topic) ) return false;
+                       Topic castOther = (Topic) other;
+                       return new EqualsBuilder()
+                                       .append(this.getId(), castOther.getId())
+                                       .isEquals();
+       }
 
+       public int hashCode() {
+                       return new HashCodeBuilder()
+                                       .append(getId())
+                                       .toHashCode();
+       }
 }