From 2113672bf2c78347a158fc75e78c2279557ec3b5 Mon Sep 17 00:00:00 2001 From: apfelmaennchen Date: Mon, 12 May 2008 15:05:27 +0000 Subject: [PATCH] small fix on tag comporator functions git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4794 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/data/bookmarksDB.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/data/bookmarksDB.java b/source/de/anomic/data/bookmarksDB.java index 2ad4a19ed..2488efbda 100644 --- a/source/de/anomic/data/bookmarksDB.java +++ b/source/de/anomic/data/bookmarksDB.java @@ -434,9 +434,12 @@ public class bookmarksDB { public Iterator getTagIterator(boolean priv, int comp, int max){ if (max==SHOW_ALL) - return getTagIterator(priv, comp); - Iterator it = getTagIterator(priv, comp); - TreeSet set=new TreeSet(new tagComparator()); + return getTagIterator(priv, comp); + Iterator it = getTagIterator(priv, SORT_SIZE); + Comparator c; + if (comp == SORT_SIZE) c = new tagSizeComparator(); + else c = new tagComparator(); + TreeSet set=new TreeSet(c); int count = 0; while (it.hasNext() && count<=max) { set.add(it.next()); @@ -446,7 +449,7 @@ public class bookmarksDB { } public Iterator getTagIterator(String tagName, boolean priv){ - return getTagIterator(tagName, priv, 1); + return getTagIterator(tagName, priv, SORT_ALPHA); } public Iterator getTagIterator(String tagName, boolean priv, int comp){ @@ -476,8 +479,11 @@ public class bookmarksDB { public Iterator getTagIterator(String tagName, boolean priv, int comp, int max){ if (max==SHOW_ALL) return getTagIterator(priv, comp); - Iterator it = getTagIterator(tagName, priv, comp); - TreeSet set=new TreeSet(new tagComparator()); + Iterator it = getTagIterator(tagName, priv, SORT_SIZE); + Comparator c; + if (comp == SORT_SIZE) c = new tagSizeComparator(); + else c = new tagComparator(); + TreeSet set=new TreeSet(c); int count = 0; while (it.hasNext() && count<=max) { set.add(it.next());