Author: tobr
Date: Fri Feb  8 15:24:12 2013
New Revision: 1444064

URL: http://svn.apache.org/r1444064
Log:
moved anchortext from linkedtask to content entity
Changed collection type of getTo to LinkedTask

Modified:
    
incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java
    
incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/LinkedTask.java

Modified: 
incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java
URL: 
http://svn.apache.org/viewvc/incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java?rev=1444064&r1=1444063&r2=1444064&view=diff
==============================================================================
--- 
incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java
 (original)
+++ 
incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java
 Fri Feb  8 15:24:12 2013
@@ -27,6 +27,9 @@ import java.util.Set;
  * The predefined members are shortcuts to default fields.
  * Otherwise you can put your meta data in the Map using your own key.
  *
+ * TODO Storing the data in a map does not seem to be the best way.
+ *      Maybe we should split it up to separate members?
+ *
  * @version 1.0
  */
 public class ContentEntity {
@@ -37,6 +40,7 @@ public class ContentEntity {
     public final static String CONTENT_TYPE = "content-type";
     public final static String CONTENT_LENGTH = "content-length";
     public final static String LINKS = "links";
+    public final static String ANCHORTEXT = "hreftitle";
 
     public final static String DEFAULT_CHARSET = "UTF-8";
 
@@ -193,6 +197,25 @@ public class ContentEntity {
         return 
Long.getLong(this.getValue(CONTENT_LENGTH).toString()).longValue();
     }
 
+
+    /**
+     * Set the title of an link
+     *
+     * @param anchorText the text
+     */
+    public void setAnchorText(String anchorText) {
+        this.put(ANCHORTEXT, anchorText);
+    }
+
+    /**
+     * Get the title of an anchor text
+     *
+     * @return the Anchor text for this link
+     */
+    public String getAnchorText() {
+        return this.getValue(ANCHORTEXT).toString();
+    }
+
     /**
      * Returns the data map.
      *

Modified: 
incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/LinkedTask.java
URL: 
http://svn.apache.org/viewvc/incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/LinkedTask.java?rev=1444064&r1=1444063&r2=1444064&view=diff
==============================================================================
--- 
incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/LinkedTask.java
 (original)
+++ 
incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/LinkedTask.java
 Fri Feb  8 15:24:12 2013
@@ -18,12 +18,8 @@ package org.apache.droids.core;
  */
 
 
-import java.net.URI;
 import java.util.Collection;
 
-import org.apache.droids.core.Task;
-
-
 /**
  * Simple extension of a {@link Task}. Adding from/to link
  * to the task object.
@@ -32,11 +28,6 @@ import org.apache.droids.core.Task;
  */
 public interface LinkedTask extends Task {
     /**
-     * @return the Anchor text for this link
-     */
-    String getAnchorText();
-
-    /**
      * From where the link was created.
      *
      * @return the parent link from where the link was coming from
@@ -48,6 +39,6 @@ public interface LinkedTask extends Task
      *
      * @return the location where the link is pointing to
      */
-    Collection<URI> getTo();
+    Collection<LinkedTask> getTo();
 
 }


Reply via email to