diff --git a/source/net/yacy/cora/document/feed/RSSFeed.java b/source/net/yacy/cora/document/feed/RSSFeed.java index 009c500ea..552dce869 100644 --- a/source/net/yacy/cora/document/feed/RSSFeed.java +++ b/source/net/yacy/cora/document/feed/RSSFeed.java @@ -36,10 +36,33 @@ public class RSSFeed implements Iterable { public static final int DEFAULT_MAXSIZE = 10000; // class variables - private RSSMessage channel; + private RSSMessage channel = null; private final Map messages; // a guid:Item map private final int maxsize; + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + if (this.channel != null) sb.append(this.channel.toString(false)); + sb.append("0\n"); + sb.append("" + this.size() + "\n"); + sb.append("" + this.size() + "\n"); + for (RSSMessage item: messages.values()) { + sb.append(item.toString()); + } + sb.append("\n"); + sb.append("\n"); + return sb.toString(); + } + public RSSFeed(final int maxsize) { this.messages = Collections.synchronizedMap(new LinkedHashMap()); this.channel = null; diff --git a/source/net/yacy/cora/document/feed/RSSMessage.java b/source/net/yacy/cora/document/feed/RSSMessage.java index 1886be789..c39892425 100644 --- a/source/net/yacy/cora/document/feed/RSSMessage.java +++ b/source/net/yacy/cora/document/feed/RSSMessage.java @@ -273,7 +273,19 @@ public class RSSMessage implements Hit, Comparable, Comparator\n"); + if (this.map.containsKey(Token.title.name())) sb.append("").append(this.map.get(Token.title.name())).append("\n"); + if (this.map.containsKey(Token.link.name())) sb.append("").append(this.map.get(Token.link.name())).append("\n"); + if (this.map.containsKey(Token.description.name())) sb.append("").append(this.map.get(Token.description.name())).append("\n"); + if (this.map.containsKey(Token.pubDate.name())) sb.append("").append(this.map.get(Token.pubDate.name())).append("\n"); + if (this.map.containsKey(Token.guid.name())) sb.append("").append(this.map.get(Token.guid.name())).append("\n"); + if (withItemTag) sb.append("\n"); + return sb.toString(); } @Override